/* Battle tactics uses the existing palette with a quiet teal accent. */
.battle-shell .battle-actions.tactics-actions { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; }
.battle-shell .tactics-actions > .command-button,
.battle-shell .tactics-actions > .battle-skill-command { grid-column: span 3; min-width: 0; }
.battle-shell .tactics-actions > .command-button { grid-template: auto auto / 20px minmax(0, 1fr); min-height: 48px; padding: 4px 6px; column-gap: 4px; text-align: left; }
.battle-shell .tactics-actions.team-switch-actions > .command-button:nth-child(n + 5) { grid-column: span 3; }
.battle-shell .tactics-actions:not(.team-switch-actions) > .command-button:nth-child(n + 5) { grid-column: span 4; }
.battle-shell .tactics-actions > .command-button > :first-child { grid-area: 1 / 1 / 3 / 2; width: 20px; height: 20px; font-size: 1.15rem; }
.battle-shell .tactics-actions .command-label { grid-area: 1 / 2; justify-self: start; max-width: 100%; font-size: .65rem; }
.battle-shell .tactics-actions .command-meta { grid-area: 2 / 2; justify-self: start; max-width: 100%; font-size: .51rem; }
.battle-shell .tactics-command { border-color: rgb(118 171 164 / 50%); }
.battle-shell.combat-animating .command-dock .tactics-command { pointer-events: auto; }
body.battle-tactics-modal-open { overflow: hidden; }
body.battle-tactics-modal-open :is(#navigation, #site-header, .global-chat) { pointer-events: none; }
.battle-tactics-backdrop { position: fixed; z-index: 250; inset: 0; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgb(3 9 13 / 79%); backdrop-filter: blur(6px); }
.battle-tactics-dialog { --tactics-accent: #91d7ca; display: flex; flex-direction: column; width: min(460px, 100%); max-height: 100%; min-height: 0; padding: 18px; border: 1px solid #526768; border-radius: 15px; color: #eef1eb; background: radial-gradient(ellipse at top left, rgb(71 111 110 / 22%), transparent 55%), linear-gradient(155deg, #1c2b32, #111b22 75%); box-shadow: 0 24px 80px rgb(0 0 0 / 65%), inset 0 1px rgb(213 236 224 / 10%); outline: none; }
.tactics-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tactics-heading .eyebrow { margin: 0 0 4px; color: var(--tactics-accent); font-size: .58rem; letter-spacing: .2em; }
.tactics-heading h2 { margin: 0; font-size: 1.25rem; letter-spacing: .1em; }
.tactics-close { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid rgb(178 204 204 / 18%); border-radius: 50%; color: #aebfbe; background: rgb(255 255 255 / 3%); font-size: 1.5rem; }
.tactics-description { margin: 9px 0 12px; color: #aabdbd; font-size: .72rem; line-height: 1.6; }
.tactics-status { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 9px 0; border-top: 1px solid rgb(177 201 198 / 12%); border-bottom: 1px solid rgb(177 201 198 / 12%); color: #a7bebb; font-size: .64rem; }
.tactics-status-dot { flex: 0 0 5px; height: 5px; border-radius: 50%; background: var(--tactics-accent); box-shadow: 0 0 7px rgb(145 215 202 / 35%); }
.tactics-status small { margin-left: auto; flex: 0 0 auto; color: var(--tactics-accent); font-size: .59rem; }
.tactics-members { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4b6667 transparent; }
.tactics-member { padding: 13px 0 11px; border-bottom: 1px solid rgb(177 201 198 / 12%); }
.tactics-member-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.tactics-portrait { display: grid; place-items: center; flex: 0 0 46px; height: 50px; border-radius: 8px; background: radial-gradient(ellipse, rgb(129 157 162 / 14%), transparent 75%); }
.tactics-portrait .actor-image { width: 100%; height: 100%; object-fit: contain; }
.tactics-member-name { min-width: 0; flex: 1 1 auto; }
.tactics-member-name small { display: block; color: #8b9c9f; font-size: .58rem; }
.tactics-member-name h3 { margin: 3px 0 2px; font-size: .87rem; line-height: 1.3; overflow-wrap: anywhere; }
.tactics-member-name > span { color: var(--tactics-accent); font-size: .61rem; }
.is-manual .tactics-member-name > span { color: #adb5bd; }
.tactics-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; min-width: 94px; min-height: 44px; padding: 7px 9px; border: 1px solid #52646b; border-radius: 24px; background: #26333c; color: #b7c4ca; font-size: .68rem; font-weight: 800; }
.tactics-toggle i { position: relative; display: block; width: 28px; height: 16px; border-radius: 12px; background: #14212a; box-shadow: inset 0 1px 3px rgb(0 0 0 / 40%); }
.tactics-toggle i::after { position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: #829599; content: ""; transition: transform 120ms ease; }
.tactics-toggle[aria-checked="true"] { border-color: #658e84; background: linear-gradient(160deg, #365c56, #213f3d); color: #c0f1e5; }
.tactics-toggle[aria-checked="true"] i { background: #102d29; }
.tactics-toggle[aria-checked="true"] i::after { background: #a1e5d5; transform: translateX(12px); box-shadow: 0 0 5px rgb(161 229 213 / 25%); }
.tactics-policies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.tactics-policy { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 44px; padding: 7px 3px; border: 1px solid #3e5059; border-radius: 7px; background: rgb(9 19 27 / 38%); color: #94a7b0; font-size: .65rem; }
.tactics-policy > span { color: #8ba6ac; font-size: .85rem; }
.tactics-policy strong { font-weight: 600; white-space: nowrap; }
.tactics-policy i { font-size: .6rem; font-style: normal; }
.tactics-policy[aria-pressed="true"] { border-color: #c5ae72; color: #ead9a6; background: linear-gradient(155deg, rgb(152 120 57 / 22%), rgb(111 84 31 / 12%)); box-shadow: inset 0 1px rgb(229 205 144 / 10%); }
.tactics-policy[aria-pressed="true"] > span { color: #dec48b; }
.tactics-policies.is-inactive { opacity: .65; }
.tactics-policy-description { margin: 6px 1px 0; color: #96a8ae; font-size: .62rem; line-height: 1.4; }
.tactics-scope { flex: 0 0 auto; margin-top: 12px; }
.tactics-scope > div:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 7px; }
.tactics-scope h3 { margin: 0; font-size: .7rem; font-weight: 600; }
.tactics-scope > div > span { color: #839a9f; font-size: .56rem; }
.tactics-scope-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; gap: 3px; border: 1px solid #354a54; border-radius: 8px; background: rgb(3 13 20 / 35%); }
.tactics-scope-options button { min-height: 44px; padding: 5px 3px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #8fa7ac; font-size: .65rem; }
.tactics-scope-options button[aria-pressed="true"] { color: #c2e4dc; border-color: #4e7773; background: #27443f; box-shadow: 0 2px 5px rgb(0 0 0 / 20%); }
.tactics-footnote { flex: 0 0 auto; margin: 10px 0 12px; color: #90a3aa; font-size: .6rem; line-height: 1.6; }
.tactics-error { margin: 0 0 8px; color: #f1aaa4; font-size: .7rem; }
.tactics-footer { display: grid; flex: 0 0 auto; grid-template-columns: 1fr 1.8fr; gap: 8px; }
.tactics-footer button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border-radius: 8px; font-size: .79rem; }
.tactics-footer .secondary-button { border: 1px solid #40565d; color: #b3c7cb; background: #1b2d35; }
.tactics-apply { border: 1px solid #94c7b5; color: #e4fff2; background: linear-gradient(155deg, #487c65, #305844); box-shadow: inset 0 1px rgb(225 255 238 / 17%), 0 5px 12px rgb(0 0 0 / 15%); font-weight: 700; }
.battle-tactics-dialog button:disabled { opacity: .45; cursor: default; }
.battle-tactics-dialog button:focus-visible { outline: 2px solid #c4f0e4; outline-offset: 2px; }
@media (max-width: 360px), (max-height: 740px) and (max-width: 700px) {
  .battle-shell .tactics-actions > .command-button { padding: 3px 4px; column-gap: 2px; }
  .battle-tactics-dialog { padding: 12px; }
  .tactics-heading h2 { font-size: 1.08rem; }
  .tactics-description { margin: 6px 0 8px; font-size: .65rem; }
  .tactics-member { padding: 9px 0; }
  .tactics-member-heading { gap: 7px; margin-bottom: 6px; }
  .tactics-portrait { flex-basis: 38px; height: 42px; }
  .tactics-policy { font-size: .61rem; gap: 3px; }
  .tactics-status { font-size: .58rem; }
  .tactics-toggle { min-width: 86px; font-size: .63rem; }
}
@media (prefers-reduced-motion: reduce) { .tactics-toggle i::after { transition: none; } }

/* Arena has the same command deck, with carried items and team switching prohibited. */
.battle-shell.arena-match .tactics-actions:not(.team-switch-actions) > .command-button:nth-child(n + 5) { grid-column: span 6; }
