/* The flock and its treasure workshop share one navigation section. */
.flock-hub-heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(330px,.85fr);gap:24px;align-items:center;margin-bottom:26px}
.flock-hub-heading>.page-head{display:block;margin:0;min-width:0}
.flock-hub-heading .page-aside{margin:14px 0 0}
.flock-section-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.flock-section-card{display:flex;gap:12px;align-items:center;min-width:0;min-height:96px;padding:17px 14px;text-align:left;color:var(--muted);background:var(--panel);border:1px solid var(--line);border-radius:14px}
.flock-section-card>span{flex:1;min-width:0}
.flock-section-card>.icon{width:24px;height:24px;flex-shrink:0;color:var(--purple)}
.flock-section-card>.icon:last-child{width:14px;height:14px}
.flock-section-card strong,.flock-section-card small{display:block;overflow-wrap:anywhere}
.flock-section-card strong{font-size:13px;color:var(--ink)}
.flock-section-card small{margin-top:7px;font-size:10px;line-height:1.5}
.flock-section-card:hover,.flock-section-card.active{border-color:var(--purple);background:var(--lilac);color:var(--purple)}
.flock-section-card:focus-visible,.equipment-party-sheep:focus-visible{outline:2px solid var(--purple);outline-offset:3px}

/* Reserve space within the frame so equipment never covers the sheep or role. */
.sheep-card .card-art{height:202px;padding:12px 20px 36px}
.sheep-frame-footer{position:absolute;left:9px;right:9px;bottom:7px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px;align-items:end;z-index:7;pointer-events:none}
.flock-gear-icons{display:flex;align-items:center;gap:3px;min-width:0;min-height:25px}
.flock-gear-icon{display:block;flex-shrink:0;width:24px;height:24px;padding:1px;border:1px solid var(--line);border-radius:6px;background:var(--panel);pointer-events:auto}
.flock-gear-icon>.gear-art{width:100%;height:100%}
.sheep-frame-role{display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:5px 6px;max-width:100%;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-size:9px;line-height:1.2;color:var(--ink);white-space:nowrap}
.sheep-frame-role .icon{width:11px;height:11px;flex-shrink:0;color:var(--purple)}
.sheep-card-ability{display:flex;align-items:center;justify-content:center;gap:5px;margin:7px 0 0;color:var(--purple);font-size:11px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}
.sheep-card-ability>.icon{width:13px;height:13px;flex-shrink:0}
.sheep-card-name{padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}
.sheep-card-name:focus-visible{outline:2px solid var(--purple);outline-offset:3px;border-radius:3px}
button.sheep-card-ability{position:relative;z-index:8;width:100%;min-height:44px;padding:7px 2px;border:0;border-radius:6px;background:none;font-family:inherit;cursor:pointer;text-align:center;touch-action:manipulation}
button.sheep-card-ability[aria-expanded="true"]{background:var(--lilac)}
@media(hover:hover) and (pointer:fine){button.sheep-card-ability:hover{background:var(--lilac)}}
button.sheep-card-ability:focus-visible{outline:2px solid var(--purple);outline-offset:2px}
.sheep-card-ability>.ability-info-icon{width:11px;height:11px;opacity:.7}
.ability-tooltip{position:fixed;z-index:100;width:min(340px,calc(100vw - 24px));padding:17px 18px;border:1px solid var(--purple);border-radius:13px;background:var(--panel);color:var(--ink);box-shadow:0 10px 36px #110a204d;text-align:left;overflow-y:auto;overscroll-behavior:contain}
.ability-tooltip[hidden]{display:none}
.ability-tooltip-close{position:absolute;top:5px;right:5px;display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer;touch-action:manipulation}
.ability-tooltip-close>.icon{width:18px;height:18px}
.ability-tooltip-close:focus-visible{outline:2px solid var(--purple)}
.ability-tooltip>.eyebrow,.ability-tooltip>strong{padding-right:28px}
.ability-tooltip>.eyebrow{font-size:8px;letter-spacing:1.1px;line-height:1.6;color:var(--muted);margin-bottom:8px}
.ability-tooltip>strong{display:block;font-family:Georgia,serif;font-size:20px;font-weight:400;line-height:1.3;color:var(--purple)}
.ability-tooltip>p{font-size:13px;line-height:1.75;margin-top:9px}
.ability-tooltip>small{display:block;font-size:10px;line-height:1.5;color:var(--muted);margin-top:12px}
.sheep-card-info .sheep-card-stats{gap:8px}

.equipment-party-panel{padding:22px;margin-bottom:20px}
.equipment-party-panel .section-title{margin-bottom:16px}
.equipment-party-panel .section-title p{margin-top:6px}
.equipment-party-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.equipment-party-sheep{display:flex;position:relative;flex-direction:column;align-items:center;gap:7px;padding:30px 12px 15px;min-width:0;border:1px solid var(--line);border-radius:13px;background:var(--paper);color:var(--ink);text-align:center}
.equipment-party-sheep:hover,.equipment-party-sheep.selected{border-color:var(--purple);background:var(--lilac)}
.equipment-party-sheep.selected{box-shadow:inset 0 0 0 1px var(--purple)}
.equipment-party-sheep>.sheep-art{width:135px;height:135px;max-width:100%}
.equipment-party-sheep>strong{font-family:Georgia,serif;font-size:23px;line-height:1.25;overflow-wrap:anywhere;max-width:100%}
.equipment-party-sheep>small{font-size:10px;line-height:1.5;color:var(--muted)}
.equipment-party-sheep .flock-gear-icons{justify-content:center}
.equipment-slot-label{position:absolute;top:12px;left:13px;letter-spacing:1.5px;font-size:8px;font-weight:800;color:var(--muted)}
.equipment-slot-check{position:absolute;right:11px;top:10px;color:var(--purple)}
.equipment-slot-check>.icon{width:16px;height:16px}
.equipment-wearer h2{font-size:25px;line-height:1.3}
.equipment-other-friends{margin-top:14px;font-size:11px;color:var(--muted)}
.equipment-other-friends>summary{cursor:pointer;min-height:30px;line-height:1.6}
.equipment-other-friends select{margin-top:8px}
#equipment-loadout{scroll-margin-top:145px}

/* Every equipment selection is a preview; only the confirmation equips it. */
.gear-replacement-choice{min-width:0;padding:15px 12px}
.gear-replacement-choice>.gear-art{width:112px;height:112px;margin:0 auto 12px;max-width:100%}
.gear-replacement-copy{display:flex;flex-direction:column;gap:9px;min-width:0;color:var(--ink)}
.gear-replacement-copy>strong{font-size:14px;line-height:1.4}
.gear-replacement-copy>small{color:var(--muted)}
.gear-replacement-copy .gear-bonuses{justify-content:center;margin-top:0}
.slot-ability{font-size:11px;line-height:1.5;color:var(--purple)}
.slot-compare-label{display:flex;justify-content:center;align-items:center;gap:5px;font-size:10px;color:var(--muted)}
.slot-compare-label>.icon{width:12px;height:12px}
.gear-comparison-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:22px}
.gear-comparison-card{min-width:0;padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.gear-comparison-card:last-child{border-color:var(--purple);background:var(--lilac)}
.gear-comparison-card>.eyebrow{font-size:8px;letter-spacing:1.3px;color:var(--muted)}
.gear-comparison-art{display:grid;place-items:center;height:125px;margin:10px 0}
.gear-comparison-art>.gear-art{height:125px;width:125px;max-width:100%}
.gear-comparison-art>.icon{height:46px;width:46px;color:var(--muted)}
.gear-comparison-card .rarity-chip{position:static;display:inline-block;font-size:9px;white-space:normal;line-height:1.6}
.gear-comparison-card h3{font-size:24px;line-height:1.3;margin-top:12px;overflow-wrap:anywhere}
.gear-comparison-card .gear-bonuses{font-size:11px;gap:8px 12px;line-height:1.5}
.gear-comparison-card .gear-bonuses>span{white-space:normal}
.gear-comparison-ability{margin-top:18px;padding-top:15px;border-top:1px solid var(--line)}
.gear-comparison-ability h4{font-size:13px;color:var(--purple);line-height:1.5;overflow-wrap:anywhere}
.gear-comparison-ability p,.gear-comparison-card>p{font-size:12px;line-height:1.8;color:var(--muted);margin-top:7px;overflow-wrap:anywhere}
.gear-move-note{display:flex;align-items:center;gap:8px;margin-top:17px;padding:12px;border:1px solid var(--line);border-radius:9px;font-size:12px;color:var(--purple)}
.gear-move-note>.icon{width:18px;height:18px;flex-shrink:0}
.gear-comparison-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:20px 0 12px}
.gear-stat-change{display:flex;flex-direction:column;align-items:center;gap:8px;padding:13px 7px;border:1px solid var(--line);border-radius:10px;background:var(--paper);min-width:0;text-align:center}
.gear-stat-change>span{display:flex;align-items:center;gap:5px;font-size:10px;color:var(--muted)}
.gear-stat-change .icon{width:13px;height:13px}
.gear-stat-change>strong{font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.gear-stat-change>small{font-size:10px;color:var(--muted)}
.gear-stat-change>small.increase{color:var(--green)}
.gear-stat-change>small.decrease,.gear-comparison-error{color:var(--danger)}
.gear-comparison-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px}
.gear-comparison-actions>.btn{flex:1 1 230px;min-width:0;min-height:46px;white-space:normal;line-height:1.6}

/* Arena height follows the complete unit cards, including supporter effects. */
.modal.battle-modal{overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.battle-arena{height:auto;min-height:470px;padding:44px 12px 24px}
.battle-arena.has-boss{height:auto;min-height:540px;padding:46px 12px 28px}
.battle-arena.has-boss .battle-team.enemies.boss-formation{row-gap:20px;align-items:start}
.battle-arena.has-boss .battle-unit{align-self:start}
.battle-arena.has-boss .unit-name{white-space:normal;line-height:1.4;overflow-wrap:anywhere}
.battle-arena.has-boss .unit-effects{min-height:26px;gap:4px;margin-top:3px}
.battle-unit .unit-shield:empty,.battle-unit .unit-effects:empty{display:none!important;min-height:0;height:0;margin:0}
.battle-status-chip{min-height:25px;line-height:1.3}
.battle-status-chip span{white-space:normal;overflow-wrap:anywhere}
.unit-skill-count{max-width:100%;white-space:normal}

@media(max-width:1180px){
 .flock-hub-heading{grid-template-columns:1fr;gap:18px}
 .flock-section-card{min-height:80px}
}
@media(max-width:700px){
 .flock-hub-heading{gap:16px;margin-bottom:20px}
 .flock-section-tabs{gap:9px}
 .flock-section-card{padding:14px 11px;gap:8px;min-height:83px}
 .flock-section-card strong{font-size:12px}
 .flock-section-card small{font-size:9px}
 .flock-section-card>.icon{width:21px;height:21px}
 .flock-section-card>.icon:last-child{width:11px;height:11px}
 .sheep-card .card-art{height:183px;padding:12px 9px 35px}
 .flock-gear-icons{gap:2px}
 .flock-gear-icon{width:22px;height:22px}
 .sheep-frame-footer{left:6px;right:6px;gap:3px;bottom:6px}
 .sheep-frame-role{font-size:8px;padding:5px 4px;gap:2px}
 .sheep-frame-role .icon{width:10px;height:10px}
 .sheep-card-ability{font-size:10px;line-height:1.4;gap:3px}
 .sheep-card-ability>.icon{width:11px;height:11px}
 .party-first-slot .card-art{height:165px;aspect-ratio:auto;padding:25px 5px 50px}
 .party-first-slot .sheep-frame-footer{grid-template-columns:1fr;justify-items:end;gap:2px}
 .party-first-slot .flock-gear-icons{justify-self:start;min-height:18px}
 .party-first-slot .flock-gear-icon{width:17px;height:17px;border-radius:4px}
 .party-first-slot .sheep-frame-role{font-size:7px;padding:3px;max-width:100%}
 .party-first-slot .sheep-card-ability{font-size:9px}
 .party-first-slot .sheep-card-ability>.icon{display:none}
 .equipment-party-panel{padding:15px}
 .equipment-party-panel .section-title h2{font-size:22px}
 .equipment-party-grid{gap:8px}
 .equipment-party-sheep{padding:29px 5px 11px;gap:6px}
 .equipment-party-sheep>.sheep-art{width:95px;height:95px}
 .equipment-party-sheep>strong{font-size:18px}
 .equipment-party-sheep>small{font-size:8px}
 .equipment-party-sheep>strong.long-name{font-size:14px}
 .party-first-slot .sheep-card-info h3.long-name{font-size:12px;overflow-wrap:anywhere}
 .equipment-party-sheep .flock-gear-icon{width:20px;height:20px}
 .equipment-slot-label{left:7px;top:10px;font-size:7px;letter-spacing:.8px}
 .equipment-slot-check{right:6px;top:9px}
 .equipment-slot-check>.icon{width:12px;height:12px}
 .equipment-wearer h2{font-size:22px}
 .equipment-other-friends{font-size:10px}
 .gear-replacement-slots{grid-template-columns:1fr;gap:10px}
 .gear-replacement-choice{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:15px;text-align:left;padding:13px}
 .gear-replacement-choice>.gear-art{width:80px;height:80px;margin:0}
 .gear-replacement-copy .gear-bonuses,.slot-compare-label{justify-content:flex-start}
 .gear-comparison-grid{gap:9px;margin-top:18px}
 .gear-comparison-card{padding:12px 10px}
 .gear-comparison-card>.eyebrow{font-size:7px;letter-spacing:.7px}
 .gear-comparison-art,.gear-comparison-art>.gear-art{height:90px}
 .gear-comparison-art>.gear-art{width:90px}
 .gear-comparison-card h3{font-size:19px}
 .gear-comparison-card .rarity-chip{font-size:8px;padding:4px 5px}
 .gear-comparison-card .gear-bonuses{font-size:10px;gap:7px}
 .gear-comparison-card .gear-bonuses .icon{width:11px;height:11px;flex-shrink:0}
 .gear-comparison-ability{margin-top:14px;padding-top:12px}
 .gear-comparison-ability h4{font-size:11px}
 .gear-comparison-ability p,.gear-comparison-card>p{font-size:11px;line-height:1.7}
 .gear-comparison-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .gear-comparison-actions{gap:9px;margin-top:18px}
 .gear-comparison-actions>.btn{font-size:12px;min-height:44px}
 .gear-move-note{font-size:11px}
 .battle-arena{height:auto;min-height:475px;padding:42px 6px 24px}
 .battle-arena.has-boss{height:auto;min-height:520px;padding:42px 6px 26px}
 .battle-arena.has-boss .battle-team.enemies.boss-formation{row-gap:18px}
 .battle-arena.has-boss .unit-effects{gap:3px}
 .boss-formation .battle-status-chip{font-size:8px;gap:2px;padding:4px 2px;min-height:25px}
 .boss-formation .battle-status-chip .icon{width:9px;height:9px}
}
@media(max-width:370px){
 .flock-gear-icon{width:19px;height:19px}
 .sheep-frame-role{font-size:7px;padding:5px 3px}
 .equipment-party-sheep>strong{font-size:16px}
 .equipment-party-sheep>small{font-size:7px}
 .equipment-party-sheep>strong.long-name{font-size:11px}
 .party-first-slot .sheep-card-info h3.long-name{font-size:11px}
 .equipment-party-sheep .flock-gear-icon{width:17px;height:17px}
 .equipment-slot-check{display:none}
 .gear-comparison-card h3{font-size:17px}
 .gear-comparison-ability p{font-size:10px}
}
