.clan-alliance-panel{min-height:0;overflow:hidden;flex-direction:column;gap:8px}.clan-alliance-panel.active{display:flex!important}.alliance-tabs{display:flex;gap:6px;overflow-x:auto;flex-shrink:0}.alliance-tabs button{white-space:nowrap}.alliance-tabs [aria-selected=true]{background:#743a40!important;color:#fff3d4!important}.alliance-content{overflow:auto;min-height:0;flex:1;padding:4px 8px 12px}.alliance-content article{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #b9a888;padding:10px 0}.alliance-content article>div:first-child{flex:1;min-width:0}.alliance-content p{margin:6px 0;line-height:1.4}.alliance-content small{display:block}.alliance-content footer,.alliance-content article>div:last-child,.alliance-dialog footer{display:flex;gap:8px;flex-wrap:wrap}.alliance-identity,.alliance-public{display:flex;align-items:center;gap:16px}.alliance-identity>svg{width:88px;height:96px}.alliance-content h3{margin:4px 0}.alliance-content button,.alliance-dialog button{min-height:38px;padding:7px 12px;border:1px solid #ab9873;background:#eadbb8;color:#35291d;font:inherit;cursor:pointer}.alliance-content button:disabled{opacity:.6;cursor:default}.alliance-editor input,.alliance-dialog input{display:block;box-sizing:border-box;width:100%;padding:8px;background:#fff4d6;color:#35291d;border:1px solid #ab9873}.alliance-rally ul{list-style:none;margin:8px 0;padding:0}.alliance-rally li{display:flex;justify-content:space-between;gap:15px;border-top:1px solid #cbb994;padding:5px 0}.alliance-rally-actions{max-width:190px}.alliance-dialog{box-sizing:border-box;width:min(650px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:5px double #b8a278;background:#f2e6c7;color:#35291d;box-shadow:0 8px 28px #0008}.alliance-dialog::backdrop{background:#0007}.alliance-dialog>header{display:flex;justify-content:space-between;align-items:center;background:#703e3d;color:#fff1cd;padding:10px 16px;gap:12px}.alliance-dialog h3{margin:0}.alliance-dialog-body{padding:16px;overflow:auto;max-height:calc(100dvh - 110px)}.alliance-dialog footer{justify-content:flex-end;margin-top:16px}.alliance-dialog article{border-bottom:1px solid #b9a888;padding:8px}.alliance-public{flex-wrap:wrap;margin:8px 0}.alliance-public svg{width:38px;height:44px}.alliance-status:empty{display:none}@media(max-height:450px){.alliance-tabs{gap:3px}.alliance-tabs button{padding:5px 8px;min-height:32px}.alliance-content{padding:0 4px 8px}.alliance-content article{padding:6px 0;gap:8px}.alliance-rally{align-items:flex-start!important}.alliance-rally-actions{max-width:150px}}@media(max-width:620px){.alliance-content article{flex-wrap:wrap}.alliance-rally-actions{max-width:none;width:100%}.alliance-rally li{font-size:13px}.alliance-identity{gap:8px}}

#profileScreen #clanContent .clan-section-nav.has-alliance{grid-template-columns:repeat(6,minmax(0,1fr))!important}

/* Reuse the player editor workspace, parchment panels and fixed action bar.
   These scoped adjustments accommodate the alliance's existing heraldry fields. */
#clanAlliancePanel .alliance-content-editing{display:flex;overflow:hidden;padding:0}
#clanAlliancePanel .alliance-editor{flex:1;height:100%;padding:0;gap:.45rem}
#clanAlliancePanel .player-flag-editor__preview-panel{position:static;grid-template-rows:auto minmax(0,1fr) auto auto}
#clanAlliancePanel .alliance-editor-preview{width:100%;height:100%;min-height:0;display:grid;place-items:center}
#clanAlliancePanel .alliance-editor-preview>span{max-width:190px;max-height:210px}
#clanAlliancePanel .alliance-editor-name{width:100%;min-width:0;font-size:.7rem;color:#50351f}
#clanAlliancePanel .alliance-editor-name input{min-height:38px;margin-top:3px;padding:5px 8px;font:inherit}
#clanAlliancePanel .player-flag-editor__tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
#clanAlliancePanel .alliance-editor-options{min-width:0;margin:0;padding:0;border:0}
#clanAlliancePanel .alliance-editor-options h4{margin:8px 0;font-size:.8rem}
#clanAlliancePanel .player-flag-editor__actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;flex-wrap:nowrap}
#profileScreen #clanContent #clanAlliancePanel .player-flag-editor__actions button{min-height:44px}
#profileScreen #clanContent #clanAlliancePanel .player-flag-editor__warning{color:#7b2227!important}
#clanAlliancePanel .clan-shield-choice-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#clanAlliancePanel .clan-shield-choice-grid button{min-width:0;min-height:60px;padding:5px;grid-template-columns:36px minmax(0,1fr);text-align:left;background:linear-gradient(180deg,#e5d5b0,#c2aa79);color:#3b2818;border-color:#927248}
#clanAlliancePanel .clan-shield-choice-grid button.active{outline:2px solid #6d2d35;outline-offset:-2px;background:linear-gradient(180deg,#f6e7c3,#cda963)}
#clanAlliancePanel .clan-shield-color-group{margin:0 0 12px;padding:8px;background:#e2d1ad;border-color:#927248}
#clanAlliancePanel .clan-shield-swatch-grid{grid-template-columns:repeat(8,minmax(32px,1fr));gap:6px}
#clanAlliancePanel .clan-shield-swatch-grid button{min-width:0;min-height:44px;height:44px;padding:0;border-radius:5px;background:var(--shield-swatch)}
#clanAlliancePanel .clan-shield-swatch-grid button.active{outline:3px solid #6d2d35;outline-offset:1px;border-color:#fff1c8}
#clanAlliancePanel .alliance-editor button:focus-visible{outline:3px solid #227297;outline-offset:-3px}
@media(max-height:460px) and (orientation:landscape){
#clanAlliancePanel .player-flag-editor__workspace{grid-template-columns:minmax(145px,.65fr) minmax(0,1.6fr);gap:6px}
#clanAlliancePanel .player-flag-editor__preview-panel{padding:4px;gap:2px}
#clanAlliancePanel .player-flag-editor__title{display:none}
#clanAlliancePanel .player-flag-editor__map-preview{font-size:10px;gap:6px}
#clanAlliancePanel .player-flag-editor__map-preview>span:last-child{width:20px;height:22px}
#clanAlliancePanel .player-flag-editor__tab{min-width:0;padding:4px 2px;font-size:11px}
#clanAlliancePanel .clan-shield-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#clanAlliancePanel .clan-shield-swatch-grid{grid-template-columns:repeat(6,minmax(32px,1fr))}
#clanAlliancePanel .player-flag-editor__actions{padding:3px;gap:6px}
#clanAlliancePanel .player-flag-editor__save-status{font-size:10px;text-align:left;line-height:1.15}
}
/* The Clan ledger's shared controls use important rules; keep this editor's
   player-style buttons scoped here without changing the other Clan panels. */
#profileScreen #clanContent #clanAlliancePanel .alliance-editor button{padding:6px!important;border-radius:4px!important;background:linear-gradient(180deg,#e5d5b0,#c2aa79)!important}
#profileScreen #clanContent #clanAlliancePanel :is(.player-flag-editor__tab.active,.profile-primary-btn){background:linear-gradient(180deg,#7d3540,#55232a)!important;color:#fff7e5!important}
#profileScreen #clanContent #clanAlliancePanel .clan-shield-choice-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
#profileScreen #clanContent #clanAlliancePanel .clan-shield-choice-grid button.active{background:linear-gradient(180deg,#f6e7c3,#cda963)!important;border-color:#6d2d35!important}
#profileScreen #clanContent #clanAlliancePanel .clan-shield-swatch-grid button{background:var(--shield-swatch)!important}
@media(max-height:460px) and (orientation:landscape){
#profileScreen #clanContent #clanAlliancePanel .clan-shield-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#profileScreen #clanContent #clanAlliancePanel .clan-shield-swatch-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:6px!important}
#profileScreen #clanContent #clanAlliancePanel .alliance-editor-name input{min-height:36px!important;padding:3px 6px!important;font-size:12px!important}
#profileScreen #clanContent #clanAlliancePanel .alliance-editor .player-flag-editor__tab{padding:3px!important;font-size:11px!important}
}

#profileScreen #clanContent:has(#clanAlliancePanel.active .alliance-editor)>.clan-section-nav{display:none!important}
