:root {
  color-scheme: dark;
  --bg: #0e1014;
  --panel: #171b22;
  --panel-2: #202734;
  --panel-3: #111720;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f4f1e9;
  --muted: #b6b0a2;
  --gold: #e8c15d;
  --red: #ef6a58;
  --green: #6bd68d;
  --blue: #65a8ff;
  --cyan: #59d2d2;
  --violet: #b58cff;
  --orange: #ff9b5c;
  --earth: #c2a26a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 32%),
    radial-gradient(circle at 20% 0%, rgba(255, 155, 92, 0.12), transparent 30%),
    radial-gradient(circle at 85% 8%, rgba(89, 210, 210, 0.09), transparent 28%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #252c38;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
  line-height: 1.2;
}

button:hover {
  border-color: var(--line-strong);
  background: #303947;
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f141d;
  color: var(--text);
  min-height: 40px;
  padding: 9px 11px;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.86);
  box-shadow: var(--shadow);
  padding: 12px;
}

.topbar-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.brand h1,
.panel-title h2,
.modal-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: clamp(22px, 3vw, 30px);
}

.brand p,
.panel-title p,
.small,
.muted {
  color: var(--muted);
}

.brand p,
.panel-title p {
  margin: 4px 0 0;
  line-height: 1.45;
}

.brand {
  display: grid;
  gap: 6px;
}

.topbar-help {
  max-width: 560px;
}

.topbar-help > summary {
  justify-content: flex-start;
  width: max-content;
  max-width: 100%;
}

.topbar-help > summary strong {
  color: var(--muted);
  font-size: 13px;
}

.resource-row,
.tab-row,
.action-row,
.inline-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.resource-pill,
.tag,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.resource-pill b,
.tag b,
.status-chip b {
  color: var(--text);
}

.resource-pill.has-icon {
  gap: 6px;
  padding-left: 5px;
}

.shell-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.shell-status-pill.is-online b,
.shell-status-pill.is-ready b {
  color: var(--green);
}

.shell-status-pill.is-offline b {
  color: var(--orange);
}

.shell-status-pill.is-installable b {
  color: var(--gold);
}

.shell-status-pill.is-pending b {
  color: var(--muted);
}

.shell-install-button {
  min-height: 32px;
  padding: 6px 10px;
  border-color: rgba(232, 193, 93, 0.4);
  background: rgba(232, 193, 93, 0.14);
  color: #ffe49a;
}

.shell-install-button:hover {
  border-color: rgba(232, 193, 93, 0.65);
  background: rgba(232, 193, 93, 0.2);
}

.shell-status-note {
  opacity: 0.82;
}

.tab-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 32, 0.74);
  padding: 8px;
}

.tab-row button.active {
  border-color: rgba(232, 193, 93, 0.56);
  background: rgba(232, 193, 93, 0.16);
  color: #ffe49a;
}

.tab-button-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.equipment-tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.equipment-tool-tabs button {
  min-height: 38px;
}

.equipment-tool-tabs button.active {
  border-color: rgba(232, 193, 93, 0.56);
  background: rgba(232, 193, 93, 0.16);
  color: #ffe49a;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 12px;
  align-items: start;
}

.map-only-layout {
  display: block;
}

.panel,
.map-panel,
.battle-panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 27, 34, 0.92);
  box-shadow: var(--shadow);
}

.panel,
.map-panel,
.battle-panel {
  padding: 12px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.panel-title h2 {
  font-size: 20px;
}

.map-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 10px;
  align-items: stretch;
}

.map-frame-solo {
  grid-template-columns: minmax(0, 1fr);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(var(--map-width, 14), minmax(0, 1fr));
  gap: 3px;
  border-radius: 8px;
  padding: 8px;
  min-height: 420px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.24)),
    url("./assets/images/maps/ash-road-tileset.png") center / cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.tile {
  position: relative;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(10, 14, 20, 0.4);
  overflow: hidden;
  width: 100%;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  text-align: inherit;
}

.tile.is-actionable {
  cursor: pointer;
}

.tile.is-current {
  border-color: rgba(232, 193, 93, 0.48);
  box-shadow: inset 0 0 0 1px rgba(232, 193, 93, 0.22);
}

.tile.is-actionable:hover,
.tile.is-actionable:focus-visible {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  outline: none;
}

.tile.grass {
  background: rgba(42, 73, 55, 0.62) url("./assets/images/maps/burning-plains-terrain-variants.png") 0% 0% / 400% 400%;
}

.tile.road {
  background: rgba(108, 82, 48, 0.72) url("./assets/images/maps/burning-plains-terrain-variants.png") 33.333% 0% / 400% 400%;
}

.tile.stone {
  background: rgba(77, 83, 92, 0.74) url("./assets/images/maps/burning-plains-terrain-variants.png") 66.666% 0% / 400% 400%;
}

.tile.forest {
  background:
    linear-gradient(135deg, rgba(111, 177, 107, 0.35), rgba(17, 63, 46, 0.78)),
    url("./assets/images/maps/burning-plains-terrain-variants.png") 0% 0% / 400% 400%;
}

.tile.water {
  background:
    radial-gradient(circle at 35% 35%, rgba(124, 214, 255, 0.36), transparent 42%),
    linear-gradient(135deg, rgba(28, 82, 124, 0.82), rgba(13, 36, 62, 0.9));
}

.tile.crystal {
  background:
    linear-gradient(135deg, rgba(190, 232, 255, 0.36), rgba(58, 84, 128, 0.78)),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, 0.12) 8px 10px);
}

.tile.storm {
  background:
    linear-gradient(135deg, rgba(110, 119, 138, 0.82), rgba(44, 49, 66, 0.92)),
    repeating-linear-gradient(-35deg, transparent 0 10px, rgba(242, 198, 93, 0.2) 10px 12px);
}

.tile.shadow {
  background:
    radial-gradient(circle at 70% 25%, rgba(181, 140, 255, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(31, 22, 50, 0.94), rgba(12, 14, 24, 0.96));
}

.tile.lava {
  background:
    radial-gradient(circle at 40% 62%, rgba(255, 141, 95, 0.52), transparent 32%),
    linear-gradient(135deg, rgba(106, 34, 26, 0.94), rgba(29, 18, 16, 0.96));
}

.tile.danger {
  background: rgba(105, 48, 39, 0.7) url("./assets/images/maps/burning-plains-terrain-variants.png") 0% 33.333% / 400% 400%;
}

.tile.portal {
  background: rgba(96, 67, 134, 0.78) url("./assets/images/maps/burning-plains-terrain-variants.png") 66.666% 33.333% / 400% 400%;
}

.tile.blocked {
  background: rgba(13, 18, 24, 0.86) url("./assets/images/maps/burning-plains-terrain-variants.png") 33.333% 33.333% / 400% 400%;
}

.tile.blocked-bump {
  animation: blocked-tile-bump 260ms ease-out both;
}

.tile.blocked-bump::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid rgba(255, 132, 91, 0.95);
  border-radius: 6px;
  background: rgba(255, 92, 66, 0.18);
  box-shadow: 0 0 16px rgba(255, 92, 66, 0.46);
  pointer-events: none;
}

.unit-token {
  position: absolute;
  inset: 3px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.unit-player {
  background: linear-gradient(135deg, #5ed09b, #5f9dff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.unit-player-sprite {
  background: rgba(0, 0, 0, 0.18);
  overflow: visible;
}

.map-player-sprite {
  width: 150%;
  height: 150%;
  background: url("./assets/images/characters/party/party-walk-sheet.png") no-repeat 0% 0% / 400% 200%;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.44));
  animation: sprite-4x2-idle 760ms steps(1, end) infinite;
}

.unit-npc {
  background: linear-gradient(135deg, #e8c15d, #b47745);
}

.unit-enemy {
  background: linear-gradient(135deg, #d85f4d, #7c2d3c);
}

.unit-node {
  background: linear-gradient(135deg, #8e76ff, #5bd0d0);
}

.map-controls {
  display: grid;
  gap: 8px;
  align-content: start;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 6px;
  justify-content: center;
}

.dpad button {
  width: 44px;
  min-height: 42px;
  padding: 0;
}

.dpad .empty {
  visibility: hidden;
}

.event-log {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.event-log div {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.game-info-drawer {
  min-width: 0;
}

.game-info-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.game-info-drawer > summary::-webkit-details-marker {
  display: none;
}

.game-info-drawer > summary::before {
  content: "+";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.game-info-drawer[open] > summary::before {
  content: "-";
}

.game-info-drawer > summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.game-info-drawer > :not(summary) {
  margin-top: 8px;
}

.map-objective-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.07);
}

.map-objective-drawer {
  border: 1px solid rgba(232, 193, 93, 0.2);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.26);
  padding: 7px 8px;
}

.map-objective-panel button {
  width: 100%;
  min-height: 38px;
}

.map-objective-panel .quest-action-strip {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.map-objective-panel .quest-action-strip > span {
  padding: 7px;
}

.map-quick-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.map-quick-panel > .small {
  margin: 0;
}

.map-quick-drawer > summary,
.map-objective-drawer > summary {
  align-items: center;
}

.map-quick-drawer > summary .tag,
.map-objective-drawer > summary .tag {
  max-width: 68%;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: right;
}

.map-quick-lead {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
}

.map-quick-lead small,
.map-quick-lead strong,
.map-quick-lead p {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
}

.map-quick-lead small {
  color: var(--muted);
  font-size: 10px;
}

.map-quick-lead strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.map-quick-lead p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.map-quick-lead button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
}

.map-quick-lead.primary {
  border-color: rgba(141, 207, 138, 0.34);
  background: rgba(141, 207, 138, 0.1);
}

.map-quick-lead.primary strong {
  color: #c8f2c0;
}

.map-quick-lead.tracked {
  border-color: rgba(232, 193, 93, 0.38);
  background: rgba(232, 193, 93, 0.1);
}

.map-quick-lead.tracked strong {
  color: var(--gold);
}

.map-quick-lead.portal {
  border-color: rgba(127, 196, 232, 0.34);
  background: rgba(127, 196, 232, 0.1);
}

.map-quick-lead.portal strong,
.map-quick-lead.info strong {
  color: var(--cyan);
}

.map-quick-lead.warn {
  border-color: rgba(232, 193, 93, 0.36);
  background: rgba(232, 193, 93, 0.09);
}

.map-quick-lead.danger {
  border-color: rgba(240, 138, 120, 0.38);
  background: rgba(240, 138, 120, 0.1);
}

.map-quick-lead.danger strong {
  color: #f3b2a6;
}

.map-quick-drawer {
  display: grid;
  gap: 8px;
}

.map-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px;
}

.map-quick-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.map-quick-card small,
.map-quick-card strong,
.map-quick-card p {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
}

.map-quick-card small {
  color: var(--muted);
  font-size: 10px;
}

.map-quick-card strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.map-quick-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.map-quick-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
}

.map-quick-card.primary {
  border-color: rgba(141, 207, 138, 0.3);
  background: rgba(141, 207, 138, 0.08);
}

.map-quick-card.primary strong {
  color: #c8f2c0;
}

.map-quick-card.tracked {
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.08);
}

.map-quick-card.tracked strong {
  color: var(--gold);
}

.map-quick-card.portal {
  border-color: rgba(127, 196, 232, 0.3);
  background: rgba(127, 196, 232, 0.08);
}

.map-quick-card.portal strong,
.map-quick-card.info strong {
  color: var(--cyan);
}

.map-quick-card.warn {
  border-color: rgba(232, 193, 93, 0.32);
  background: rgba(232, 193, 93, 0.07);
}

.map-quick-card.danger {
  border-color: rgba(240, 138, 120, 0.34);
  background: rgba(240, 138, 120, 0.08);
}

.map-quick-card.danger strong {
  color: #f3b2a6;
}

.objective-proof-strip,
.objective-action-row {
  display: grid;
  gap: 6px;
}

.objective-proof-strip {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.objective-proof-chip {
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.44);
  padding: 7px;
  text-align: left;
}

button.objective-proof-chip {
  cursor: pointer;
}

button.objective-proof-chip:hover {
  border-color: rgba(232, 193, 93, 0.3);
  background: rgba(232, 193, 93, 0.08);
}

button.objective-proof-chip:focus-visible {
  outline: 2px solid rgba(232, 193, 93, 0.7);
  outline-offset: 1px;
}

.objective-proof-chip small,
.objective-proof-chip b,
.objective-proof-chip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.objective-proof-chip small,
.objective-proof-chip em,
.gate-status-note {
  color: var(--muted);
  font-size: 10px;
}

.objective-proof-chip b {
  color: var(--text);
  font-size: 12px;
}

.objective-proof-chip.done {
  border-color: rgba(141, 207, 138, 0.34);
  background: rgba(141, 207, 138, 0.08);
}

.objective-proof-chip.ready {
  border-color: rgba(127, 196, 232, 0.34);
  background: rgba(127, 196, 232, 0.08);
}

.objective-proof-chip.active {
  border-color: rgba(232, 193, 93, 0.38);
  background: rgba(232, 193, 93, 0.09);
}

.objective-proof-chip.recommended {
  border-color: rgba(127, 196, 232, 0.34);
  background: rgba(127, 196, 232, 0.08);
}

.objective-proof-chip.idle {
  border-color: rgba(255, 255, 255, 0.12);
}

.objective-proof-chip.active b {
  color: var(--gold);
}

.objective-proof-chip.recommended b {
  color: var(--cyan);
}

.objective-proof-chip.ready b {
  color: var(--cyan);
}

.objective-proof-chip.done b {
  color: #a2dda0;
}

.objective-action-row {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.objective-action-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gate-status-note {
  margin: 0;
}

.gate-proof-note {
  margin: 0 0 6px;
}

.map-help-drawer .event-log {
  max-height: 180px;
  overflow: auto;
}

.encounter-card {
  display: grid;
  gap: 7px;
}

.encounter-quick-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 5px;
}

.encounter-quick-strip span {
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.18);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.045);
  padding: 5px 6px;
}

.encounter-quick-strip small,
.encounter-quick-strip b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.encounter-quick-strip small {
  color: var(--muted);
  font-size: 9px;
}

.encounter-quick-strip b {
  color: var(--cyan);
  font-size: 11px;
}

.encounter-lineup,
.encounter-intent-strip,
.encounter-pressure-strip,
.encounter-counter-plan,
.encounter-pressure-grid,
.encounter-advice-grid {
  display: grid;
  gap: 5px;
}

.encounter-lineup {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.encounter-intent-strip {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.encounter-pressure-strip {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.encounter-pressure-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.encounter-counter-plan {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.encounter-advice-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.encounter-lineup span,
.encounter-intent-strip span,
.encounter-pressure-strip span,
.encounter-counter-plan span,
.encounter-pressure-grid span,
.encounter-advice-grid span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px;
}

.encounter-lineup span.first-opener {
  border-color: rgba(232, 193, 93, 0.48);
  background: rgba(232, 193, 93, 0.08);
}

.encounter-lineup span.first-opener b {
  color: var(--gold);
}

.encounter-lineup span.first-opener small:last-child {
  color: var(--gold);
}

.encounter-lineup span.top-threat {
  border-color: rgba(240, 138, 120, 0.5);
  background: rgba(240, 138, 120, 0.08);
}

.encounter-lineup span.top-threat b {
  color: #f08a78;
}

.encounter-lineup span.top-threat small:last-child {
  color: #f08a78;
}

.encounter-lineup span.first-opener.top-threat {
  border-color: rgba(232, 193, 93, 0.6);
  background: rgba(232, 193, 93, 0.1);
}

.encounter-lineup span.first-opener.top-threat b,
.encounter-lineup span.first-opener.top-threat small:last-child {
  color: var(--gold);
}

.encounter-lineup b,
.encounter-lineup small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.encounter-lineup b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.encounter-lineup small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.32;
}

.encounter-intent-strip span {
  border-color: rgba(232, 193, 93, 0.24);
  background: rgba(232, 193, 93, 0.08);
  color: var(--gold);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.encounter-pressure-strip span,
.encounter-pressure-grid span {
  border-color: rgba(127, 196, 232, 0.2);
  background: rgba(127, 196, 232, 0.05);
  padding: 6px;
}

.encounter-pressure-grid span {
  padding: 5px;
}

.encounter-pressure-grid span.dominant-pressure {
  border-color: rgba(232, 193, 93, 0.5);
  background: rgba(232, 193, 93, 0.09);
}

.encounter-pressure-grid span.dominant-pressure small,
.encounter-pressure-grid span.dominant-pressure b {
  color: var(--gold);
}

.encounter-pressure-strip span.encounter-priority-level {
  border-color: rgba(240, 138, 120, 0.38);
  background: rgba(240, 138, 120, 0.07);
}

.encounter-pressure-strip span.encounter-priority-level b {
  color: #f08a78;
}

.encounter-pressure-strip span.encounter-skill-window {
  border-color: rgba(232, 193, 93, 0.3);
  background: rgba(232, 193, 93, 0.065);
}

.encounter-pressure-strip span.encounter-skill-window b {
  color: var(--gold);
}

.skill-window-line,
.skill-window-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  min-width: 0;
}

.skill-window-line {
  margin-top: 3px;
}

.skill-window-part {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.055);
  padding: 1px 4px;
  color: var(--text);
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.skill-window-part.pressure {
  background: rgba(232, 193, 93, 0.13);
  color: var(--gold);
}

.skill-window-part.name {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 800;
}

.skill-window-part.power {
  background: rgba(127, 196, 232, 0.1);
  color: var(--cyan);
}

.skill-window-part.target {
  background: rgba(141, 207, 138, 0.1);
  color: var(--green);
}

.skill-window-part.effect {
  background: rgba(240, 138, 120, 0.11);
  color: #f08a78;
}

.skill-window-part.cooldown,
.skill-window-part.opening {
  color: var(--muted);
}

.encounter-advice-grid span {
  border-color: rgba(141, 207, 138, 0.2);
  background: rgba(141, 207, 138, 0.055);
  padding: 6px;
}

.encounter-pressure-strip small,
.encounter-pressure-strip b,
.encounter-counter-plan small,
.encounter-counter-plan b,
.encounter-pressure-grid small,
.encounter-pressure-grid b,
.encounter-advice-grid small,
.encounter-advice-grid b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.encounter-pressure-strip small,
.encounter-counter-plan small,
.encounter-pressure-grid small,
.encounter-advice-grid small {
  color: var(--muted);
  font-size: 9px;
}

.encounter-pressure-strip b,
.encounter-counter-plan b,
.encounter-pressure-grid b,
.encounter-advice-grid b {
  color: var(--cyan);
  font-size: 11px;
}

.encounter-advice-grid b {
  color: var(--green);
}

.encounter-counter-plan span {
  border-color: rgba(232, 193, 93, 0.22);
  background: rgba(232, 193, 93, 0.06);
}

.encounter-counter-plan b {
  color: var(--gold);
}

.team-grid,
.spirit-grid,
.quest-grid,
.equipment-grid {
  display: grid;
  gap: 8px;
}

.quest-board {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  align-items: start;
}

.quest-current-rail {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(232, 193, 93, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(232, 193, 93, 0.14), rgba(89, 210, 255, 0.06)),
    rgba(10, 16, 30, 0.84);
  box-shadow: inset 0 0 0 1px rgba(232, 193, 93, 0.08);
  padding: 10px;
}

.quest-current-copy {
  display: grid;
  gap: 4px;
}

.quest-current-copy p {
  margin: 0;
}

.quest-current-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}

.quest-current-summary span {
  min-width: 0;
  border: 1px solid rgba(232, 193, 93, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 7px;
  display: grid;
  gap: 2px;
}

.quest-current-summary small,
.quest-current-summary b,
.quest-current-summary em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
  font-style: normal;
}

.quest-current-summary small,
.quest-current-summary em {
  color: var(--muted);
  font-size: 10px;
}

.quest-current-summary b {
  color: #fff1b6;
  font-size: 12px;
}

.quest-current-actions {
  margin-top: 0;
}

.quest-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  align-content: start;
}

.quest-card.quest-main {
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.08);
}

.quest-card.quest-focus-panel {
  grid-column: 1 / -1;
  border-color: rgba(232, 193, 93, 0.4);
  background:
    linear-gradient(135deg, rgba(232, 193, 93, 0.12), rgba(89, 210, 255, 0.08)),
    rgba(10, 16, 30, 0.82);
  box-shadow: inset 0 0 0 1px rgba(232, 193, 93, 0.12);
}

.quest-card.quest-side {
  border-color: rgba(89, 210, 255, 0.24);
}

.quest-card.quest-repeatable {
  border-color: rgba(121, 231, 169, 0.22);
  background: rgba(121, 231, 169, 0.05);
}

.quest-card.is-tracked {
  border-color: rgba(232, 193, 93, 0.5);
  box-shadow: inset 0 0 0 1px rgba(232, 193, 93, 0.18);
  background: rgba(232, 193, 93, 0.08);
}

.quest-proof-list span {
  min-width: 0;
}

.quest-proof-summary-strip,
.npc-quest-brief-block {
  display: grid;
  gap: 6px;
}

.quest-proof-summary-strip .objective-proof-chip {
  background: rgba(255, 255, 255, 0.04);
}

.quest-item-proof-chip {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
}

.quest-item-proof-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quest-item-proof-copy b,
.quest-item-proof-copy em {
  overflow-wrap: anywhere;
}

.quest-step-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
}

.quest-step-strip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 2px;
}

.quest-step-strip small {
  color: var(--muted);
  font-size: 10px;
}

.quest-step-strip b {
  font-size: 12px;
}

.quest-step-strip .quest-next-step-chip,
.npc-quest-brief-strip .quest-next-step-chip,
.npc-quest-guidance-strip .quest-next-step-chip {
  border-color: rgba(232, 193, 93, 0.34);
  background: linear-gradient(135deg, rgba(232, 193, 93, 0.14), rgba(89, 210, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(232, 193, 93, 0.1);
}

.quest-step-strip .quest-next-step-chip b,
.npc-quest-brief-strip .quest-next-step-chip b,
.npc-quest-guidance-strip .quest-next-step-chip b {
  color: #fff3c4;
}

.quest-action-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 6px;
}

.quest-action-strip > span {
  border: 1px solid rgba(232, 193, 93, 0.2);
  border-radius: 8px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(232, 193, 93, 0.08), rgba(89, 210, 255, 0.04));
  display: grid;
  gap: 3px;
}

.quest-action-strip small,
.quest-action-strip b,
.quest-action-strip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.32;
}

.quest-action-strip small,
.quest-action-strip em {
  color: var(--muted);
  font-size: 10px;
}

.quest-action-strip b {
  color: #fff1b6;
  font-size: 12px;
}

.quest-action-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: auto;
}

.quest-action-row > .small {
  grid-column: 1 / -1;
}

.quest-action-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
}

.quest-action-row button.quest-next-action {
  border-color: rgba(232, 193, 93, 0.48);
  background: linear-gradient(135deg, rgba(232, 193, 93, 0.18), rgba(89, 210, 255, 0.08));
  color: #fff3c4;
}

.quest-action-row button.active {
  border-color: rgba(232, 193, 93, 0.5);
  background: rgba(232, 193, 93, 0.14);
  color: #fff3c4;
}

.quest-board-proof-strip {
  display: grid;
  gap: 6px;
}

.quest-main-action-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.inline-row button.active {
  border-color: rgba(232, 193, 93, 0.5);
  background: rgba(232, 193, 93, 0.14);
  color: #fff3c4;
}

.spirit-portrait {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.sprite-spirit-large {
  width: min(86%, 220px);
  aspect-ratio: 1 / 0.82;
}

.spirit-phase-gallery {
  display: grid;
  gap: 8px;
}

.spirit-phase-quality-list {
  display: grid;
  gap: 7px;
}

.spirit-quality-drawer,
.asset-subdrawer,
.chapter-generated-asset-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

.spirit-quality-drawer[open],
.asset-subdrawer[open],
.chapter-generated-asset-drawer[open] {
  background: rgba(255, 255, 255, 0.045);
}

.spirit-phase-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 7px;
}

.spirit-phase-gallery-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 6px;
}

.spirit-phase-gallery-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.spirit-phase-gallery-card small,
.spirit-phase-gallery-card b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.spirit-phase-gallery-card small {
  color: var(--muted);
  font-size: 10px;
}

.spirit-phase-gallery-card b {
  color: var(--text);
  font-size: 11px;
}

.asset-implementation-panel {
  display: grid;
  gap: 10px;
}

.asset-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.asset-progress-card,
.asset-preview-block,
.asset-ui-sheet-card,
.asset-effect-card,
.asset-story-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.asset-progress-card {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.asset-progress-card small,
.asset-progress-card em,
.asset-effect-card small,
.asset-ui-sheet-card small,
.asset-story-card small {
  color: var(--muted);
}

.asset-progress-card b {
  font-size: 13px;
}

.asset-progress-card em {
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
}

.asset-progress-card.status-live {
  border-color: rgba(102, 214, 164, 0.32);
  background: rgba(102, 214, 164, 0.08);
}

.asset-progress-card.status-partial {
  border-color: rgba(232, 193, 93, 0.35);
  background: rgba(232, 193, 93, 0.08);
}

.asset-progress-card.status-blocked {
  border-color: rgba(255, 124, 124, 0.32);
  background: rgba(255, 124, 124, 0.08);
}

.asset-hook-panel {
  display: grid;
  gap: 8px;
}

.asset-hook-head,
.asset-hook-title {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.asset-hook-title {
  justify-content: flex-start;
}

.asset-hook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 8px;
}

.asset-hook-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  padding: 9px;
}

.asset-hook-badge {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 1px solid rgba(129, 224, 255, 0.24);
  border-radius: 8px;
  background: rgba(129, 224, 255, 0.08);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.asset-hook-card small,
.asset-hook-card b,
.asset-hook-card em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.asset-hook-card small,
.asset-hook-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.asset-hook-card b {
  color: var(--text);
  font-size: 12px;
}

.runtime-contract-showcase {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(129, 224, 255, 0.18);
  border-radius: 8px;
  background: rgba(129, 224, 255, 0.05);
  padding: 8px;
}

.runtime-contract-showcase-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.runtime-contract-showcase-group small {
  color: var(--muted);
  font-size: 10px;
}

.runtime-contract-icon-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
}

.runtime-contract-icon {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  padding: 6px 4px;
}

.runtime-contract-icon em {
  display: block;
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-item-copy-panel {
  margin-top: 8px;
}

.pending-item-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.pending-item-copy-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(232, 193, 93, 0.18);
  border-radius: 8px;
  background: rgba(232, 193, 93, 0.06);
  padding: 8px;
}

.pending-item-copy-card span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pending-item-copy-card small,
.pending-item-copy-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pending-item-copy-card b {
  color: var(--text);
  font-size: 12px;
}

.asset-preview-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.asset-preview-block {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.asset-effect-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.asset-effect-card,
.asset-story-card {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.asset-effect-card img,
.asset-story-card img,
.asset-ui-sheet-card img {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.38);
}

.asset-effect-card img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 6px;
}

.asset-ui-sheet-card {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.asset-ui-sheet-card img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  padding: 8px;
}

.asset-ui-sheet-card b {
  font-size: 12px;
  line-height: 1.45;
}

.asset-story-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.asset-story-card img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.team-grid {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  align-items: start;
}

.readiness-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(232, 193, 93, 0.22);
  border-radius: 8px;
  background: rgba(232, 193, 93, 0.055);
  padding: 10px;
}

.readiness-threat-grid,
.readiness-plan-strip,
.readiness-window-grid,
.readiness-check-grid,
.readiness-action-grid,
.readiness-skill-grid,
.readiness-spirit-grid,
.readiness-gear-grid,
.readiness-enemy-skill-grid,
.readiness-advice-grid {
  display: grid;
  gap: 6px;
}

.readiness-threat-grid {
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
}

.readiness-plan-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.readiness-window-grid {
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
}

.readiness-check-grid {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
}

.readiness-advice-grid {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
}

.readiness-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.readiness-skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.readiness-spirit-grid {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.readiness-gear-grid {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.readiness-enemy-skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
}

.readiness-threat,
.readiness-plan-strip span,
.readiness-window,
.readiness-check,
.readiness-action-grid span,
.readiness-skill-grid span,
.readiness-spirit-grid span,
.readiness-gear-grid span,
.readiness-enemy-skill-grid span,
.readiness-advice-grid span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.56);
  padding: 6px;
}

.readiness-plan-strip span {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.readiness-plan-strip span.focus {
  border-color: rgba(232, 193, 93, 0.38);
  background: rgba(232, 193, 93, 0.085);
}

.readiness-plan-strip span.warn {
  border-color: rgba(214, 111, 92, 0.34);
  background: rgba(214, 111, 92, 0.075);
}

.readiness-plan-strip span.ok {
  border-color: rgba(141, 207, 138, 0.28);
  background: rgba(141, 207, 138, 0.065);
}

.readiness-plan-strip span.grow {
  border-color: rgba(181, 140, 255, 0.26);
  background: rgba(181, 140, 255, 0.065);
}

.readiness-window {
  display: grid;
  gap: 2px;
  border-color: rgba(127, 196, 232, 0.2);
  background: rgba(127, 196, 232, 0.055);
}

.readiness-threat {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 7px;
}

.readiness-threat > b,
.readiness-check > b {
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #11151c;
  line-height: 1;
}

.readiness-threat > b {
  grid-row: span 4;
  width: 28px;
  min-height: 28px;
  background: #e8c15d;
  font-size: 12px;
}

.readiness-threat.top-threat {
  border-color: rgba(232, 193, 93, 0.52);
  background: rgba(232, 193, 93, 0.09);
}

.readiness-priority {
  color: var(--cyan) !important;
  font-weight: 800;
}

.readiness-threat.intent-debuff > b {
  background: #d66f5c;
}

.readiness-threat.intent-tempo > b {
  background: #7fc4e8;
}

.readiness-threat.intent-guard > b {
  background: #8dcf8a;
}

.readiness-threat.intent-boss > b {
  background: #e06060;
  color: #fff;
}

.readiness-threat strong,
.readiness-threat small,
.readiness-threat em,
.readiness-plan-strip small,
.readiness-plan-strip b,
.readiness-plan-strip em,
.readiness-window small,
.readiness-window b,
.readiness-window em,
.readiness-check strong,
.readiness-check small,
.readiness-check em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.readiness-threat strong,
.readiness-plan-strip b,
.readiness-window b,
.readiness-check strong {
  color: var(--text);
  font-size: 12px;
}

.readiness-threat small,
.readiness-threat em,
.readiness-plan-strip small,
.readiness-plan-strip em,
.readiness-window small,
.readiness-window em,
.readiness-check small,
.readiness-check em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.readiness-plan-strip small {
  color: var(--cyan);
  font-weight: 800;
}

.readiness-plan-strip b {
  color: var(--gold);
}

.readiness-plan-strip .warn b {
  color: #f08a78;
}

.readiness-plan-strip .ok b {
  color: #a2dda0;
}

.readiness-plan-strip .grow b {
  color: #d7c4ff;
}

.readiness-window small {
  color: var(--cyan);
  font-weight: 800;
}

.readiness-window.intent-debuff b {
  color: #f08a78;
}

.readiness-window.intent-tempo b {
  color: #91d4f2;
}

.readiness-window.intent-guard b {
  color: #a2dda0;
}

.readiness-window.intent-boss b {
  color: #ff8e8e;
}

.readiness-check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 7px;
}

.readiness-check > b {
  grid-row: span 3;
  width: 24px;
  min-height: 24px;
  background: #8dcf8a;
  font-size: 11px;
}

.readiness-check.warn > b {
  background: #e8c15d;
}

.readiness-advice-grid span {
  border-color: rgba(141, 207, 138, 0.2);
  background: rgba(141, 207, 138, 0.055);
}

.readiness-action-grid span {
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.085);
}

.readiness-action-grid span.priority-urgent {
  border-color: rgba(255, 142, 142, 0.44);
  background: rgba(255, 142, 142, 0.08);
}

.readiness-action-grid span.priority-high {
  border-color: rgba(232, 193, 93, 0.44);
  background: rgba(232, 193, 93, 0.09);
}

.readiness-action-grid span.priority-mid {
  border-color: rgba(141, 207, 138, 0.32);
  background: rgba(141, 207, 138, 0.065);
}

.readiness-action-grid span.priority-low {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.readiness-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 3px 0;
}

.readiness-action-meta i {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 2px 5px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.readiness-action-meta .gear {
  border-color: rgba(127, 196, 232, 0.25);
  color: var(--cyan);
}

.readiness-action-meta .skill {
  border-color: rgba(232, 193, 93, 0.28);
  color: var(--gold);
}

.readiness-action-meta .spirit {
  border-color: rgba(181, 140, 255, 0.3);
  color: #d7c4ff;
}

.readiness-action-meta .urgent {
  border-color: rgba(255, 142, 142, 0.35);
  color: #ff8e8e;
}

.readiness-action-meta .high {
  border-color: rgba(232, 193, 93, 0.32);
  color: var(--gold);
}

.readiness-action-meta .mid {
  border-color: rgba(141, 207, 138, 0.28);
  color: #a2dda0;
}

.readiness-action-meta .low {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

.readiness-detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  padding: 5px 6px;
}

.readiness-detail-heading strong,
.readiness-detail-heading small,
.readiness-detail-heading em {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.readiness-detail-heading strong {
  color: var(--text);
  font-size: 11px;
}

.readiness-detail-heading small,
.readiness-detail-heading em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.readiness-detail-heading.skill {
  border-color: rgba(232, 193, 93, 0.22);
}

.readiness-detail-heading.spirit {
  border-color: rgba(181, 140, 255, 0.24);
}

.readiness-detail-heading.gear {
  border-color: rgba(127, 196, 232, 0.22);
}

.readiness-skill-grid span {
  border-color: rgba(232, 193, 93, 0.22);
  background: rgba(232, 193, 93, 0.06);
}

.readiness-spirit-grid span {
  border-color: rgba(181, 140, 255, 0.24);
  background: rgba(181, 140, 255, 0.06);
}

.readiness-gear-grid span {
  border-color: rgba(127, 196, 232, 0.22);
  background: rgba(127, 196, 232, 0.06);
}

.readiness-skill-grid span.priority-urgent,
.readiness-spirit-grid span.priority-urgent,
.readiness-gear-grid span.priority-urgent {
  border-color: rgba(255, 142, 142, 0.38);
  background: rgba(255, 142, 142, 0.07);
}

.readiness-skill-grid span.priority-high,
.readiness-spirit-grid span.priority-high,
.readiness-gear-grid span.priority-high {
  border-color: rgba(232, 193, 93, 0.36);
  background: rgba(232, 193, 93, 0.07);
}

.readiness-skill-grid span.priority-mid,
.readiness-spirit-grid span.priority-mid,
.readiness-gear-grid span.priority-mid {
  border-color: rgba(141, 207, 138, 0.28);
  background: rgba(141, 207, 138, 0.055);
}

.readiness-skill-grid span.priority-low,
.readiness-spirit-grid span.priority-low,
.readiness-gear-grid span.priority-low {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.readiness-enemy-skill-grid span {
  border-color: rgba(214, 111, 92, 0.22);
  background: rgba(214, 111, 92, 0.055);
}

.readiness-enemy-skill-grid span.pressure-urgent {
  border-color: rgba(240, 138, 120, 0.46);
  background: rgba(240, 138, 120, 0.085);
}

.readiness-enemy-skill-grid span.pressure-high {
  border-color: rgba(232, 193, 93, 0.38);
  background: rgba(232, 193, 93, 0.075);
}

.readiness-enemy-skill-grid span.pressure-mid {
  border-color: rgba(127, 196, 232, 0.26);
  background: rgba(127, 196, 232, 0.06);
}

.readiness-enemy-meta .target {
  border-color: rgba(141, 207, 138, 0.22);
  color: var(--green);
}

.readiness-enemy-meta .element {
  border-color: rgba(127, 196, 232, 0.22);
  color: var(--cyan);
}

.readiness-enemy-counter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
  min-width: 0;
}

.readiness-enemy-counter i {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(232, 193, 93, 0.18);
  border-radius: 6px;
  background: rgba(232, 193, 93, 0.06);
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  padding: 2px 5px;
  overflow-wrap: anywhere;
}

.readiness-advice-grid small,
.readiness-advice-grid b,
.readiness-action-grid small,
.readiness-action-grid b,
.readiness-action-grid em,
.readiness-skill-grid small,
.readiness-skill-grid b,
.readiness-skill-grid em,
.readiness-spirit-grid small,
.readiness-spirit-grid b,
.readiness-spirit-grid em,
.readiness-gear-grid small,
.readiness-gear-grid b,
.readiness-gear-grid em,
.readiness-enemy-skill-grid small,
.readiness-enemy-skill-grid b,
.readiness-enemy-skill-grid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.readiness-advice-grid small,
.readiness-action-grid small,
.readiness-action-grid em,
.readiness-skill-grid small,
.readiness-skill-grid em,
.readiness-spirit-grid small,
.readiness-spirit-grid em,
.readiness-gear-grid small,
.readiness-gear-grid em,
.readiness-enemy-skill-grid small,
.readiness-enemy-skill-grid em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.readiness-advice-grid b,
.readiness-action-grid b,
.readiness-skill-grid b,
.readiness-spirit-grid b,
.readiness-gear-grid b,
.readiness-enemy-skill-grid b {
  color: var(--green);
  font-size: 12px;
}

.readiness-skill-grid b {
  color: var(--gold);
}

.readiness-action-grid b {
  color: var(--gold);
}

.readiness-spirit-grid b {
  color: #d7c4ff;
}

.readiness-gear-grid b {
  color: var(--cyan);
}

.readiness-enemy-skill-grid b {
  color: #f08a78;
}

.readiness-detail-block {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.42);
}

.readiness-detail-block > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  padding: 8px;
}

.readiness-detail-block > summary::-webkit-details-marker {
  display: none;
}

.readiness-detail-block > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(127, 196, 232, 0.14);
  color: var(--cyan);
}

.readiness-detail-block[open] > summary::before {
  content: "-";
}

.readiness-detail-block > :not(summary) {
  margin: 0 8px 8px;
}

.readiness-counter-row span {
  background: rgba(232, 193, 93, 0.08);
  border-color: rgba(232, 193, 93, 0.24);
  color: var(--gold);
}

.unit-fit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.unit-fit-tags span {
  min-width: 0;
  border: 1px solid rgba(141, 207, 138, 0.32);
  border-radius: 8px;
  background: rgba(141, 207, 138, 0.08);
  color: #bff0bd;
  padding: 5px 7px;
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.unit-fit-tags span.warn {
  border-color: rgba(232, 193, 93, 0.35);
  background: rgba(232, 193, 93, 0.08);
  color: var(--gold);
}

.element-status-line {
  display: flex;
  min-width: 0;
}

.element-status-line span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 5px 7px;
  overflow-wrap: anywhere;
}

.element-status-line b,
.element-status-line small,
.element-status-line em {
  display: block;
  min-width: 0;
  line-height: 1.28;
}

.element-status-line b {
  color: var(--text);
  font-size: 11px;
}

.element-status-line small {
  color: var(--muted);
  font-size: 10px;
}

.element-status-line em {
  color: var(--cyan);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.element-status-line .element-active {
  border-color: rgba(141, 207, 138, 0.42);
  background: rgba(141, 207, 138, 0.09);
}

.element-status-line .element-active b {
  color: #a8e6a3;
}

.element-status-line .element-dormant {
  border-color: rgba(232, 193, 93, 0.38);
  background: rgba(232, 193, 93, 0.08);
}

.element-status-line .element-dormant b {
  color: var(--gold);
}

.element-status-line .element-empty {
  opacity: 0.72;
}

.spirit-system-guide {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(127, 196, 232, 0.18);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.045);
  padding: 10px;
}

.spirit-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 6px;
}

.spirit-guide-grid span {
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.2);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.46);
  padding: 7px;
}

.spirit-guide-grid small,
.spirit-guide-grid b,
.spirit-guide-grid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.spirit-guide-grid small,
.spirit-guide-grid em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.spirit-guide-grid b {
  color: var(--cyan);
  font-size: 12px;
  margin: 2px 0;
}

.spirit-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 9px;
  min-width: 0;
}

.char-card,
.spirit-card,
.enemy-card,
.ally-card {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.char-card.bench {
  opacity: 0.72;
}

.char-card.deployed {
  border-color: rgba(232, 193, 93, 0.5);
  box-shadow: inset 0 0 0 1px rgba(232, 193, 93, 0.16);
}

.portrait {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 150px;
  max-height: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.08), transparent 42%),
    #151b24;
  display: grid;
  place-items: center;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
  display: block;
}

.portrait .fallback,
.spirit-sigil {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(20px, 6vw, 42px);
}

.spirit-sigil {
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 74px;
  color: #fff;
}

.spirit-cutout {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 170px;
  object-fit: contain;
  object-position: center bottom;
  padding: 8px;
  box-sizing: border-box;
  filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.36));
}

.char-card .portrait,
.spirit-card .spirit-portrait {
  height: 170px;
}

.spirit-card .spirit-portrait {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.fire {
  background: linear-gradient(135deg, #8d2d22, #ff875f);
}

.water {
  background: linear-gradient(135deg, #1d4a72, #62c4ff);
}

.earth {
  background: linear-gradient(135deg, #4c3d26, #c9a86b);
}

.wind {
  background: linear-gradient(135deg, #1c563d, #78dfa0);
}

.light {
  background: linear-gradient(135deg, #6c5d22, #ffe78d);
  color: #332712;
}

.dark {
  background: linear-gradient(135deg, #291b45, #b58cff);
}

.name-line {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
}

.name-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bars {
  display: grid;
  gap: 4px;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.bar.energy > span {
  background: var(--gold);
}

.bar.resource > span {
  background: #65a8ff;
}

.bar.atb > span {
  background: linear-gradient(90deg, #f2c65d, #ff8d5f);
}

.bar.cooldown > span {
  background: linear-gradient(90deg, #73ead9, #7ea7ff);
}

.bar.manifest > span {
  background: var(--violet);
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stat-line span {
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 5px;
}

.world-stage-panel,
.progression-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.map-design-card {
  margin-bottom: 8px;
}

.map-drop-grid,
.skill-role-meta {
  display: grid;
  gap: 6px;
}

.map-drop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-drop-grid span,
.skill-role-meta span,
.skill-route-card,
.role-relation-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  padding: 7px;
}

.map-drop-grid small,
.map-drop-grid b,
.skill-role-meta small,
.skill-role-meta b,
.skill-route-card b,
.skill-route-card span,
.skill-route-card small,
.role-relation-card p {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.map-drop-grid small,
.skill-role-meta small,
.skill-route-card span,
.skill-route-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.map-drop-grid b,
.skill-role-meta b,
.skill-route-card b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}

.map-drop-grid .audit-stable,
.world-stage.audit-stable {
  border-color: rgba(118, 213, 139, 0.3);
}

.map-drop-grid .audit-spike,
.world-stage.audit-spike {
  border-color: rgba(232, 193, 93, 0.42);
}

.map-drop-grid .audit-severe,
.world-stage.audit-severe {
  border-color: rgba(240, 138, 120, 0.5);
}

.world-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.world-stage {
  min-height: 64px;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 3px;
  background: rgba(15, 20, 29, 0.82);
}

.world-stage-thumb {
  width: 100%;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2px;
}

.world-stage.active {
  border-color: rgba(232, 193, 93, 0.72);
  background: rgba(232, 193, 93, 0.13);
}

.world-stage b,
.world-stage small {
  display: block;
  overflow-wrap: anywhere;
}

.world-stage small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.stage-teleport-panel .world-stage-grid {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.stage-teleport-panel .world-stage {
  min-height: 52px;
}

.stage-visual-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(140px, 0.9fr);
  gap: 8px;
  align-items: stretch;
}

.stage-visual-preview-image {
  width: 100%;
  min-height: 124px;
  max-height: 168px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.stage-visual-preview-copy {
  display: grid;
  gap: 4px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px;
}

.stage-visual-preview-copy strong,
.stage-visual-preview-copy small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-visual-preview-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.chapter-monster-preview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.chapter-monster-preview-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 6px;
}

.chapter-monster-preview-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.chapter-monster-preview-card small {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.chapter-generated-asset-block {
  display: grid;
  gap: 8px;
}

.chapter-generated-asset-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.chapter-generated-asset-head strong,
.chapter-generated-asset-head small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chapter-generated-asset-head small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
}

.chapter-asset-structure-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 7px;
}

.chapter-asset-structure-strip span {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  padding: 8px;
}

.chapter-asset-structure-strip small,
.chapter-asset-structure-strip b,
.chapter-asset-structure-strip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.chapter-asset-structure-strip small,
.chapter-asset-structure-strip em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.chapter-asset-structure-strip b {
  color: var(--text);
  font-size: 12px;
}

.chapter-stage-asset-gallery,
.chapter-monster-asset-gallery {
  display: grid;
  gap: 6px;
}

.chapter-stage-asset-gallery {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.chapter-monster-asset-gallery {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.chapter-stage-asset-tile,
.chapter-monster-asset-tile {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
}

.chapter-stage-asset-tile img,
.chapter-monster-asset-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.chapter-stage-asset-tile small,
.chapter-monster-asset-tile small,
.chapter-stage-asset-tile em {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chapter-stage-asset-tile small,
.chapter-monster-asset-tile small {
  color: var(--text);
}

.progression-panel {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.progression-card {
  display: grid;
  gap: 7px;
}

.bar.exp > span {
  background: linear-gradient(90deg, var(--cyan), var(--gold));
}

.quality-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 5px;
}

.quality-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px;
}

.quality-chip b,
.quality-chip small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.quality-chip b {
  font-size: 12px;
  color: var(--gold);
}

.quality-chip small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.equipment-slots,
.loadout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 5px;
}

.branch-tree,
.equipment-summary,
.spirit-kit,
.build-action-strip,
.build-summary,
.formula-line {
  display: grid;
  gap: 6px;
}

.branch-tree {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px;
  background: rgba(0, 0, 0, 0.14);
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.branch-node,
.spirit-kit span,
.equipment-summary span,
.build-action-strip span,
.build-summary span,
.formula-line span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px;
}

.branch-node {
  width: 100%;
  height: auto;
  text-align: left;
  cursor: pointer;
}

.branch-node:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.branch-node.active {
  border-color: rgba(232, 193, 93, 0.62);
  background: rgba(232, 193, 93, 0.12);
}

.branch-node b,
.branch-node small,
.spirit-kit b,
.spirit-kit small,
.equipment-summary b,
.equipment-summary small,
.build-action-strip b,
.build-action-strip small,
.build-summary b,
.build-summary small,
.formula-line b,
.formula-line small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.branch-node b,
.spirit-kit b,
.equipment-summary b,
.build-action-strip b,
.build-summary b,
.formula-line b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.branch-node small,
.spirit-kit small,
.equipment-summary small,
.build-action-strip small,
.build-summary small,
.formula-line small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.32;
}

.spirit-kit {
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
}

.build-action-strip {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.build-action-strip span {
  border-color: rgba(127, 196, 232, 0.22);
  background: rgba(127, 196, 232, 0.065);
}

.build-action-strip b {
  color: var(--cyan);
}

.build-summary {
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
}

.build-summary span {
  border-color: rgba(232, 193, 93, 0.2);
  background: rgba(232, 193, 93, 0.075);
}

.build-summary b {
  color: var(--gold);
  font-size: 13px;
}

.skill-coeff-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 5px;
}

.skill-coeff-strip span {
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.24);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.055);
  padding: 6px;
}

.skill-coeff-strip small,
.skill-coeff-strip b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.skill-coeff-strip small {
  color: var(--muted);
  font-size: 9px;
}

.skill-coeff-strip b {
  color: var(--cyan);
  font-size: 11px;
}

.spirit-control-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.spirit-control-strip span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
}

.spirit-control-strip small,
.spirit-control-strip b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.spirit-control-strip small {
  color: var(--muted);
  font-size: 9px;
}

.spirit-control-strip b {
  color: var(--cyan);
  font-size: 11px;
}

.spirit-control-strip.control-main span {
  border-color: rgba(141, 207, 138, 0.36);
  background: rgba(141, 207, 138, 0.08);
}

.spirit-control-strip.control-main b {
  color: #a8e6a3;
}

.spirit-control-strip.control-sub span {
  border-color: rgba(232, 193, 93, 0.28);
  background: rgba(232, 193, 93, 0.065);
}

.spirit-control-strip.control-sub b {
  color: var(--gold);
}

.spirit-control-strip.control-bench {
  opacity: 0.72;
}

.char-card.control-main,
.spirit-card.control-main {
  border-color: rgba(141, 207, 138, 0.42);
}

.char-card.control-sub,
.spirit-card.control-sub {
  border-color: rgba(232, 193, 93, 0.25);
}

.control-action-row button {
  width: 100%;
}

.party-row-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 6px;
}

.party-row-control span,
.party-row-control div {
  min-width: 0;
}

.party-row-control span small,
.party-row-control span b,
.party-row-control span em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.24;
}

.party-row-control span small,
.party-row-control span em {
  color: var(--muted);
  font-size: 9px;
}

.party-row-control span b {
  color: var(--cyan);
  font-size: 12px;
}

.party-row-control div {
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  gap: 4px;
}

.party-row-control button {
  min-height: 32px;
  padding: 5px 7px;
  white-space: nowrap;
}

.party-row-control button.active {
  border-color: rgba(232, 193, 93, 0.58);
  background: rgba(232, 193, 93, 0.13);
  color: var(--gold);
}

.auto-policy-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.auto-policy-strip span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
}

.auto-policy-strip small,
.auto-policy-strip b,
.auto-policy-strip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.auto-policy-strip small,
.auto-policy-strip em {
  color: var(--muted);
  font-size: 9px;
}

.auto-policy-strip b {
  color: var(--cyan);
  font-size: 11px;
}

.auto-policy-strip .policy-ok {
  border-color: rgba(141, 207, 138, 0.3);
  background: rgba(141, 207, 138, 0.07);
}

.auto-policy-strip .policy-ok b {
  color: #a8e6a3;
}

.auto-policy-strip .policy-main {
  border-color: rgba(89, 210, 255, 0.3);
  background: rgba(89, 210, 255, 0.06);
}

.auto-policy-strip .policy-locked {
  border-color: rgba(232, 193, 93, 0.24);
  background: rgba(232, 193, 93, 0.055);
}

.auto-policy-strip .policy-locked b {
  color: var(--gold);
}

.equipment-summary {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.equipment-summary .equipment-element-active {
  border-color: rgba(141, 207, 138, 0.42);
  background: rgba(141, 207, 138, 0.09);
}

.equipment-summary .equipment-element-active b {
  color: #a8e6a3;
}

.equipment-summary .equipment-element-dormant {
  border-color: rgba(232, 193, 93, 0.38);
  background: rgba(232, 193, 93, 0.08);
}

.equipment-summary .equipment-element-dormant b {
  color: var(--gold);
}

.equipment-summary .equipment-element-empty {
  opacity: 0.72;
}

.formula-line {
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
}

.formula-line span {
  background: rgba(255, 255, 255, 0.04);
}

.formula-line b {
  color: var(--cyan);
}

.compact-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}

.equipment-slots > span,
.equipment-slot-button,
.skill-chip,
.skill-book-pill {
  display: block;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 6px;
}

.equipment-slot-button {
  width: 100%;
  min-height: 82px;
  text-align: left;
  cursor: pointer;
}

.equipment-slot-button:hover {
  border-color: rgba(127, 196, 232, 0.45);
  background: rgba(127, 196, 232, 0.075);
}

.equipment-slot-content {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.equipment-slot-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.equipment-slots small,
.equipment-slots b,
.equipment-slot-button small,
.equipment-slot-button b,
.skill-chip b,
.skill-chip small,
.skill-book-pill b,
.skill-book-pill small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.equipment-slots small,
.equipment-slot-button small,
.skill-chip small,
.skill-book-pill small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.equipment-slots b,
.equipment-slot-button b,
.skill-chip b,
.skill-book-pill b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.loadout-box {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 7px;
  background: rgba(0, 0, 0, 0.14);
}

.loadout-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.loadout-grid .skill-chip.has-element-selector {
  grid-column: 1 / -1;
}

.skill-chip.active,
.skill-book-pill.equipped-now {
  border-color: rgba(232, 193, 93, 0.55);
  background: rgba(232, 193, 93, 0.1);
}

.skill-chip.empty,
.skill-book-pill.empty {
  opacity: 0.72;
}

.skill-chip button {
  width: 100%;
  margin-top: 5px;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 11px;
}

.skill-element-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 6px;
  margin-top: 5px;
}

.skill-element-selector button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 7px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}

.skill-element-selector button.active {
  border-color: rgba(232, 193, 93, 0.62);
  background: rgba(232, 193, 93, 0.14);
  color: var(--gold);
}

.stat-allocator-grid,
.inventory-grid,
.equipment-picker-grid {
  display: grid;
  gap: 6px;
}

.stat-allocator-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-allocator-grid span,
.inventory-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px;
}

.inventory-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.inventory-item-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inventory-icon-placeholder {
  display: grid;
  width: 34px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 1px solid rgba(129, 224, 255, 0.25);
  border-radius: 8px;
  background: rgba(129, 224, 255, 0.08);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.runtime-asset-icon {
  display: block;
  width: 34px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border: 1px solid rgba(129, 224, 255, 0.25);
  border-radius: 8px;
  background: rgba(129, 224, 255, 0.08);
}

.runtime-asset-glyph,
.runtime-asset-glyph-fallback {
  display: inline-grid;
  flex: 0 0 auto;
  width: 18px;
  aspect-ratio: 1 / 1;
  place-items: center;
  border: 1px solid rgba(129, 224, 255, 0.24);
  border-radius: 5px;
  background: rgba(129, 224, 255, 0.08);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  object-fit: contain;
}

.runtime-asset-glyph {
  padding: 1px;
}

.resource-icon {
  width: 16px;
  border-radius: 999px;
}

.tab-icon,
.tool-tab-icon {
  width: 18px;
}

.contract-icon {
  width: 28px;
  border-radius: 7px;
}

.action-status-icon,
.action-button-icon,
.command-icon {
  width: 16px;
  border-radius: 5px;
}

.action-status-heading,
.command-button-title,
.battle-command-state-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.action-status-heading {
  justify-self: start;
}

.action-status-heading small,
.command-button-title b,
.battle-command-state-title small,
.action-button-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.action-button-text {
  line-height: 1.18;
}

.contract-item-grid {
  margin-bottom: 4px;
}

.contract-inventory-item em {
  color: var(--gold);
}

.inventory-asset-note {
  margin: 0;
}

.stat-allocator-grid small,
.stat-allocator-grid b,
.stat-allocator-grid em,
.inventory-item small,
.inventory-item b,
.inventory-item em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.stat-allocator-grid small,
.inventory-item small,
.inventory-item em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.stat-allocator-grid b,
.inventory-item b {
  color: var(--text);
  font-size: 12px;
}

.stat-allocator-grid em {
  color: var(--cyan);
  font-size: 10px;
  font-style: normal;
}

.stat-allocator-grid button {
  width: 100%;
  min-height: 28px;
  margin-top: 5px;
  padding: 3px;
}

.inventory-grid,
.equipment-picker-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.skill-inventory-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.inventory-item {
  text-align: left;
}

button.inventory-item {
  min-height: 94px;
}

.inventory-item.quality-sr,
.inventory-item.quality-ssr,
.inventory-item.quality-s {
  border-color: rgba(232, 193, 93, 0.36);
  background: rgba(232, 193, 93, 0.075);
}

.inventory-item.quality-sr b,
.inventory-item.quality-ssr b,
.inventory-item.quality-s b {
  color: var(--gold);
}

.forge-panel {
  display: grid;
  gap: 10px;
}

.forge-rule-grid,
.forge-rate-strip,
.forge-grid,
.forge-actions,
.forge-affix-list {
  display: grid;
  gap: 7px;
}

.forge-rule-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.forge-rate-strip {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.forge-rule-grid span,
.forge-rate-strip span,
.forge-card,
.forge-affix-list span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.forge-rule-grid small,
.forge-rule-grid b,
.forge-rule-grid em,
.forge-rate-strip small,
.forge-rate-strip b,
.forge-rate-strip em,
.forge-card small,
.forge-card b,
.forge-card em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.forge-rule-grid small,
.forge-rate-strip small,
.forge-card small,
.forge-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.forge-rule-grid b,
.forge-rate-strip b {
  color: var(--gold);
  font-size: 13px;
}

.forge-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.forge-card {
  display: grid;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.forge-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.forge-actions button,
.forge-affix-list button {
  width: 100%;
  min-height: 30px;
}

.forge-affix-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.forge-affix-list span {
  border-color: rgba(232, 193, 93, 0.22);
  background: rgba(232, 193, 93, 0.055);
}

.forge-affix-list b {
  color: var(--cyan);
  font-size: 12px;
}

.empty-state {
  display: block;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.equipment-picker-modal {
  width: min(980px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
}

.skill-codex {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.codex-section,
.codex-role-card,
.unit-detail-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.codex-section,
.unit-detail-block {
  display: grid;
  gap: 8px;
  padding: 0;
}

.codex-section[open],
.codex-role-card[open],
.unit-detail-block[open] {
  background: rgba(255, 255, 255, 0.055);
}

.codex-section > summary,
.codex-role-card > summary,
.unit-detail-block > summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px;
  cursor: pointer;
  line-height: 1.25;
}

.codex-section > summary::-webkit-details-marker,
.codex-role-card > summary::-webkit-details-marker,
.unit-detail-block > summary::-webkit-details-marker {
  display: none;
}

.codex-section > summary::before,
.codex-role-card > summary::before,
.unit-detail-block > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(232, 193, 93, 0.14);
  color: var(--gold);
}

.codex-section[open] > summary::before,
.codex-role-card[open] > summary::before,
.unit-detail-block[open] > summary::before {
  content: "-";
}

.codex-section > summary strong,
.codex-role-card > summary strong,
.unit-detail-block > summary strong {
  margin-right: auto;
  color: var(--text);
  font-size: 13px;
}

.codex-section > :not(summary),
.codex-role-card > :not(summary),
.unit-detail-block > :not(summary) {
  margin: 0 9px 9px;
}

.skill-rule-grid,
.skill-role-grid,
.monster-codex-grid,
.equipment-branch-grid,
.equipment-rule-grid {
  display: grid;
  gap: 8px;
}

.skill-guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.skill-guide-grid span {
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.22);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.055);
  padding: 8px;
}

.skill-guide-grid small,
.skill-guide-grid b,
.skill-guide-grid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.skill-guide-grid small,
.skill-guide-grid em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.skill-guide-grid b {
  color: var(--cyan);
  font-size: 12px;
  margin: 2px 0;
}

.equipment-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  gap: 8px;
}

.equipment-guide-grid span {
  min-width: 0;
  border: 1px solid rgba(141, 207, 138, 0.2);
  border-radius: 8px;
  background: rgba(141, 207, 138, 0.055);
  padding: 8px;
}

.equipment-guide-grid small,
.equipment-guide-grid b,
.equipment-guide-grid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.equipment-guide-grid small,
.equipment-guide-grid em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.equipment-guide-grid b {
  color: var(--green);
  font-size: 12px;
  margin: 2px 0;
}

.skill-rule-grid,
.equipment-rule-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill-role-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skill-role-card,
.rule-card {
  align-content: start;
}

.skill-list {
  display: grid;
  gap: 5px;
}

.skill-route-grid,
.role-relation-grid {
  display: grid;
  gap: 8px;
}

.skill-route-grid {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.role-relation-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.equipment-codex {
  display: grid;
  gap: 8px;
}

.equipment-rule-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.equipment-rule-grid div,
.equipment-role-card,
.branch-pill {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px;
}

.equipment-rule-grid small,
.equipment-rule-grid b,
.branch-pill b,
.branch-pill small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.equipment-rule-grid small,
.branch-pill small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.32;
}

.equipment-rule-grid b,
.branch-pill b {
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.equipment-branch-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.equipment-role-card {
  display: grid;
  gap: 7px;
}

.branch-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.branch-pill {
  background: rgba(255, 255, 255, 0.04);
}

.branch-pill:hover {
  border-color: rgba(232, 193, 93, 0.45);
  background: rgba(232, 193, 93, 0.08);
}

.monster-codex {
  display: grid;
  gap: 8px;
}

.monster-audit-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.monster-audit-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 7px;
}

.monster-audit-card small,
.monster-audit-card b,
.monster-audit-card em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.monster-audit-card small,
.monster-audit-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.monster-audit-card b {
  color: var(--text);
  font-size: 12px;
}

.monster-audit-counter {
  display: grid;
  gap: 3px;
  margin: 6px 0;
}

.monster-audit-counter i {
  display: block;
  min-width: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 10px;
  font-style: normal;
  line-height: 1.3;
  overflow-wrap: anywhere;
  padding: 4px 5px;
}

.monster-audit-card.audit-stable {
  border-color: rgba(118, 213, 139, 0.28);
  background: rgba(118, 213, 139, 0.055);
}

.monster-audit-card.audit-spike {
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.07);
}

.monster-audit-card.audit-severe {
  border-color: rgba(240, 138, 120, 0.38);
  background: rgba(240, 138, 120, 0.07);
}

.monster-balance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.monster-balance-grid span {
  min-width: 0;
  border: 1px solid rgba(232, 193, 93, 0.2);
  border-radius: 8px;
  background: rgba(232, 193, 93, 0.055);
  padding: 7px;
}

.monster-balance-grid small,
.monster-balance-grid b,
.monster-balance-grid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.monster-balance-grid small,
.monster-balance-grid em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.monster-balance-grid b {
  color: var(--gold);
  font-size: 12px;
}

.monster-balance-grid .intent-debuff b {
  color: #f08a78;
}

.monster-balance-grid .intent-tempo b {
  color: #91d4f2;
}

.monster-balance-grid .intent-guard b {
  color: #a2dda0;
}

.monster-codex-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.monster-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  padding: 7px;
}

.monster-card.pressure-critical {
  border-color: rgba(240, 138, 120, 0.5);
  background: rgba(240, 138, 120, 0.065);
}

.monster-card.pressure-high {
  border-color: rgba(232, 193, 93, 0.42);
  background: rgba(232, 193, 93, 0.055);
}

.monster-card.pressure-stable {
  border-color: rgba(141, 207, 138, 0.24);
}

.monster-card .monster-pressure-badge {
  border-color: rgba(141, 207, 138, 0.28);
  color: var(--green);
}

.monster-card.pressure-critical .monster-pressure-badge {
  border-color: rgba(240, 138, 120, 0.48);
  color: #f08a78;
}

.monster-card.pressure-high .monster-pressure-badge {
  border-color: rgba(232, 193, 93, 0.46);
  color: var(--gold);
}

.monster-card-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.monster-portrait {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.monster-portrait img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.monster-intent-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(232, 193, 93, 0.26);
  border-radius: 8px;
  background: rgba(232, 193, 93, 0.08);
  padding: 5px;
}

.monster-intent-row b {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--gold);
  font-size: 13px;
}

.monster-intent-row span {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.monster-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.monster-stat-grid span,
.counter-chip-row span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px;
}

.monster-stat-grid small,
.monster-stat-grid b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.monster-stat-grid small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.monster-stat-grid b {
  color: var(--gold);
  font-size: 12px;
  line-height: 1.3;
}

.monster-tactic-grid b {
  color: var(--cyan);
}

.monster-action-hint {
  color: var(--green) !important;
  font-weight: 800;
}

.monster-counter-plan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.monster-counter-plan span {
  min-width: 0;
  border: 1px solid rgba(232, 193, 93, 0.2);
  border-radius: 8px;
  background: rgba(232, 193, 93, 0.055);
  padding: 5px;
}

.monster-counter-plan small,
.monster-counter-plan b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.monster-counter-plan small {
  color: var(--muted);
  font-size: 9px;
}

.monster-counter-plan b {
  color: var(--gold);
  font-size: 11px;
}

.monster-pressure-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.monster-tuning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 5px;
}

.monster-pressure-grid span,
.monster-tuning-grid span {
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.18);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.045);
  padding: 5px;
}

.monster-pressure-grid span.dominant-pressure {
  border-color: rgba(232, 193, 93, 0.5);
  background: rgba(232, 193, 93, 0.09);
}

.monster-tuning-grid span {
  border-color: rgba(141, 207, 138, 0.2);
  background: rgba(141, 207, 138, 0.045);
}

.monster-pressure-grid small,
.monster-pressure-grid b,
.monster-tuning-grid small,
.monster-tuning-grid b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.monster-pressure-grid small,
.monster-tuning-grid small {
  color: var(--muted);
  font-size: 9px;
}

.monster-pressure-grid b {
  color: var(--cyan);
  font-size: 12px;
}

.monster-pressure-grid span.dominant-pressure small,
.monster-pressure-grid span.dominant-pressure b {
  color: var(--gold);
}

.monster-tuning-grid b {
  color: var(--green);
  font-size: 11px;
}

.counter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.counter-chip-row span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.skill-route-card {
  display: grid;
  gap: 3px;
}

.skill-route-card b {
  color: var(--gold);
}

.role-relation-card {
  display: grid;
  gap: 5px;
}

.role-book-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.common-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.skill-book-pill[class*="quality-s"],
.skill-book-pill.quality-ssr {
  border-color: rgba(232, 193, 93, 0.42);
  background: rgba(232, 193, 93, 0.08);
}

.skill-book-pill.quality-a,
.skill-book-pill.quality-b {
  border-color: rgba(101, 168, 255, 0.36);
  background: rgba(101, 168, 255, 0.07);
}

.battle-scene {
  display: grid;
  gap: 10px;
  background:
    linear-gradient(90deg, rgba(11, 14, 20, 0.94), rgba(11, 14, 20, 0.64)),
    url("./assets/images/backgrounds/burning-plains.png") center / cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.battle-intent-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 6px;
}

.intent-card {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 2px 6px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.72);
  padding: 6px;
}

.intent-card.top-threat {
  border-color: rgba(232, 193, 93, 0.62);
  background: rgba(232, 193, 93, 0.1);
}

.intent-card.skill-ready,
.skill-timing.skill-ready {
  border-color: rgba(240, 138, 120, 0.66);
  background: rgba(240, 138, 120, 0.1);
}

.intent-card.skill-soon,
.skill-timing.skill-soon {
  border-color: rgba(232, 193, 93, 0.56);
  background: rgba(232, 193, 93, 0.095);
}

.intent-card > b {
  grid-row: span 6;
  display: grid;
  place-items: center;
  width: 26px;
  min-height: 26px;
  border-radius: 7px;
  background: #e8c15d;
  color: #11151c;
  font-size: 11px;
  line-height: 1;
}

.intent-card strong,
.intent-card small,
.intent-card em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.intent-card strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
}

.intent-card small,
.intent-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.28;
}

.intent-card .intent-threat {
  color: var(--gold);
}

.intent-card .intent-band {
  color: var(--text);
  font-weight: 800;
}

.intent-card .intent-action {
  color: var(--green);
  font-weight: 800;
}

.intent-card .intent-priority {
  color: var(--cyan);
  font-weight: 800;
}

.intent-card.intent-debuff > b {
  background: #d66f5c;
}

.intent-card.intent-tempo > b {
  background: #7fc4e8;
}

.intent-card.intent-guard > b {
  background: #8dcf8a;
}

.intent-card.intent-boss > b {
  background: #e06060;
  color: #fff;
}

.intent-card.pressure-critical,
.skill-timing.pressure-critical {
  border-color: rgba(240, 138, 120, 0.78);
  background: rgba(240, 138, 120, 0.12);
}

.intent-card.pressure-high,
.skill-timing.pressure-high {
  border-color: rgba(232, 193, 93, 0.62);
  background: rgba(232, 193, 93, 0.1);
}

.intent-card.pressure-stable,
.skill-timing.pressure-stable {
  border-color: rgba(141, 207, 138, 0.26);
}

.enemy-skill-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
  gap: 6px;
}

.skill-timing {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.68);
  padding: 7px 8px;
}

.skill-timing.primary {
  border-color: rgba(232, 193, 93, 0.62);
  background: rgba(232, 193, 93, 0.11);
}

.skill-timing small,
.skill-timing b,
.skill-timing em {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.skill-timing small {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
}

.skill-timing b {
  color: var(--gold);
  font-size: 12px;
}

.skill-timing em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.skill-timing-counter {
  display: grid;
  gap: 3px;
  margin-top: 3px;
}

.skill-timing-counter i {
  display: block;
  min-width: 0;
  border-radius: 6px;
  background: rgba(232, 193, 93, 0.07);
  color: var(--text);
  font-size: 10px;
  font-style: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
  padding: 3px 5px;
}

.skill-timing.intent-debuff b {
  color: #f08a78;
}

.skill-timing.intent-tempo b {
  color: #91d4f2;
}

.skill-timing.intent-guard b {
  color: #a2dda0;
}

.skill-timing.intent-boss b {
  color: #ff8e8e;
}

.battle-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.battlefield {
  position: relative;
  min-height: clamp(540px, 56vw, 760px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.06), rgba(7, 10, 15, 0.34)),
    url("./assets/images/backgrounds/burning-plains.png") center bottom / cover;
}

.battlefield::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 92px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 92px),
    linear-gradient(180deg, transparent 0 42%, rgba(0, 0, 0, 0.42) 100%);
  transform: none;
  transform-origin: 50% 68%;
  opacity: 0.5;
  pointer-events: none;
}

.battlefield::after {
  content: "";
  position: absolute;
  inset: 56% 4% 4%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(8, 10, 14, 0.1), rgba(8, 10, 14, 0.34) 72%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

.battle-side {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.battle-unit {
  position: absolute;
  width: clamp(66px, 5.8vw, 94px);
  min-height: 122px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  pointer-events: auto;
  overflow: visible;
  isolation: isolate;
  transform: translate(-50%, -50%);
}

.battle-unit:disabled {
  opacity: 1;
  cursor: default;
}

.battle-unit.targetable {
  cursor: pointer;
}

.battle-unit.targetable .unit-stage {
  outline: 0;
}

.battle-unit.active .unit-stage {
  outline: 0;
}

.battle-unit.targetable .sprite-frame,
.battle-unit.targetable .battle-sprite {
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.36)) drop-shadow(0 0 10px rgba(101, 168, 255, 0.9));
}

.battle-unit.active .sprite-frame,
.battle-unit.active .battle-sprite {
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.36)) drop-shadow(0 0 12px rgba(232, 193, 93, 0.95));
}

.battle-unit.selected-target .sprite-frame,
.battle-unit.selected-target .battle-sprite {
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.36)) drop-shadow(0 0 14px rgba(121, 231, 169, 0.95));
}

.battle-unit.ready .unit-hud {
  border-color: rgba(232, 193, 93, 0.62);
  box-shadow: 0 0 0 1px rgba(232, 193, 93, 0.18), 0 8px 20px rgba(0, 0, 0, 0.32);
}

.battle-unit.defeated {
  opacity: 0.42;
  filter: grayscale(0.75);
}

.unit-stage {
  position: relative;
  min-height: clamp(94px, 7.6vw, 128px);
  display: grid;
  place-items: end center;
  overflow: visible;
  border-radius: 8px;
  background: transparent !important;
}

.unit-stage::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 2px;
  height: 12px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  filter: blur(2px);
  z-index: -1;
}

.unit-hud {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  width: max-content;
  min-width: 78px;
  max-width: 104px;
  transform: translateX(-50%);
  z-index: 3;
  display: grid;
  gap: 1px;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.84);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  text-align: left;
}

.unit-hud strong,
.unit-hud span {
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}

.enemy-unit .enemy-hud-hint {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--gold);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-hud > span {
  display: none;
}

.spirit-unit .unit-hud > .spirit-hud-control {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: #b58cff;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-unit .unit-hud > .character-hud-branch {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--green);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-hud .bar {
  height: 5px;
}

.ally-unit.manual-control .unit-hud {
  border-color: rgba(141, 207, 138, 0.42);
}

.ally-unit.auto-only .unit-hud {
  border-color: rgba(232, 193, 93, 0.28);
}

.unit-intent {
  display: none;
  margin-top: 1px;
  color: rgba(244, 241, 233, 0.76);
  font-size: 10px;
  line-height: 1.15;
  max-width: 132px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.82);
}

.enemy-unit .unit-intent {
  position: absolute;
  left: 50%;
  bottom: -24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: max-content;
  max-width: 148px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(7, 10, 14, 0.76);
  color: rgba(244, 241, 233, 0.86);
  transform: translateX(-50%);
  white-space: normal;
}

.enemy-unit .unit-intent.skill-ready {
  border-color: rgba(240, 138, 120, 0.64);
  background: rgba(36, 14, 13, 0.9);
}

.enemy-unit .unit-intent.skill-soon {
  border-color: rgba(232, 193, 93, 0.58);
  background: rgba(34, 26, 12, 0.9);
}

.enemy-unit .unit-intent.pressure-critical {
  border-color: rgba(240, 138, 120, 0.74);
  background: rgba(37, 14, 12, 0.92);
}

.enemy-unit .unit-intent.pressure-high {
  border-color: rgba(232, 193, 93, 0.66);
  background: rgba(35, 27, 13, 0.9);
}

.enemy-unit .unit-intent.pressure-stable {
  border-color: rgba(107, 214, 141, 0.34);
}

.enemy-unit .unit-intent b {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #11151c;
  background: #e8c15d;
  font-size: 9px;
  line-height: 1;
}

.enemy-unit .unit-intent i,
.enemy-unit .unit-intent strong,
.enemy-unit .unit-intent small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-style: normal;
  line-height: 1.12;
}

.enemy-unit .unit-intent strong {
  color: var(--text);
  font-size: 10px;
}

.enemy-unit .unit-intent small {
  color: var(--muted);
  font-size: 8px;
}

.enemy-unit .unit-intent .unit-pressure-band {
  color: var(--gold);
  font-weight: 800;
}

.enemy-unit .unit-intent.pressure-critical .unit-pressure-band {
  color: #f08a78;
}

.enemy-unit .unit-intent.pressure-stable .unit-pressure-band {
  color: var(--green);
}

.enemy-unit .intent-debuff b {
  background: #d66f5c;
}

.enemy-unit .intent-tempo b {
  background: #7fc4e8;
}

.enemy-unit .intent-guard b {
  background: #8dcf8a;
}

.enemy-unit .intent-boss b {
  background: #e06060;
  color: #fff;
}

.battle-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 16, 23, 0.78);
  padding: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  transform: translateZ(0);
}

.battle-card:disabled {
  opacity: 1;
  cursor: default;
}

.battle-card.active {
  border-color: rgba(232, 193, 93, 0.72);
  box-shadow: 0 0 0 1px rgba(232, 193, 93, 0.28);
}

.battle-card.targetable {
  border-color: rgba(101, 168, 255, 0.58);
  cursor: pointer;
}

.battle-card.defeated {
  opacity: 0.46;
  filter: grayscale(0.75);
}

.battle-card img {
  width: 100%;
  aspect-ratio: 1 / 0.8;
  object-fit: contain;
  display: block;
}

.sprite-frame {
  --sprite-url: none;
  width: 100%;
  aspect-ratio: 1 / 0.82;
  background-image: var(--sprite-url);
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-position: 0% 0%;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.36));
  animation: sprite-4x2-idle 960ms steps(1, end) infinite;
  transform-origin: 50% 86%;
}

.battle-unit .sprite-frame {
  aspect-ratio: 1 / 2;
  animation: none;
}

.sprite-frame.is-action {
  animation-duration: 620ms;
}

.battle-sprite {
  display: block;
  height: auto;
  max-height: var(--sprite-max-height, clamp(96px, 9vw, 150px));
  object-fit: contain;
  object-position: center bottom;
  box-sizing: border-box;
  padding: 2px;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.36));
  transform-origin: 50% 86%;
  user-select: none;
  pointer-events: none;
}

.sprite-ally {
  width: var(--sprite-width, min(100%, 96px));
  justify-self: center;
  align-self: end;
  transform: none;
}

.battle-gear-overlay {
  display: grid;
  min-width: 110px;
  gap: 3px;
  justify-items: center;
}

.battle-gear-owner {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #ffe49a;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.battle-gear-owner-full {
  display: inline;
}

.battle-gear-owner-short {
  display: none;
}

.battle-gear-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 3px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(232, 193, 93, 0.42);
  border-radius: 999px;
  background: rgba(6, 8, 12, 0.86);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.battle-gear-roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(104px, 1fr));
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 8px;
  border: 1px solid rgba(232, 193, 93, 0.2);
  border-radius: 10px;
  background: rgba(9, 12, 18, 0.76);
  scrollbar-width: thin;
}

.battle-gear-context {
  grid-column: 1 / -1;
  justify-self: start;
  color: #ffe49a;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.78);
}

.battle-gear-roster .battle-gear-overlay {
  min-width: 0;
}

.battle-gear-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(232, 193, 93, 0.55);
  border-radius: 4px;
  background: rgba(12, 14, 18, 0.82);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.34);
}

.battle-gear-icon .runtime-asset-glyph,
.battle-gear-icon .runtime-asset-glyph-fallback {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
  line-height: 1;
}

.battle-gear-icon::after {
  content: attr(data-slot);
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  min-width: 8px;
  height: 8px;
  place-items: center;
  border-top-left-radius: 4px;
  background: rgba(5, 8, 12, 0.88);
  color: #e8c15d;
  font-size: 6px;
  font-weight: 900;
  line-height: 1;
}

.sprite-enemy {
  width: var(--sprite-width, min(108%, 104px));
  margin: 0 auto;
  transform: scaleX(-1);
}

.battle-mark {
  width: var(--sprite-width, 76px);
  height: var(--sprite-width, 76px);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.32);
}

.spirit-unit .sprite-ally {
  width: var(--sprite-width, min(108%, 92px));
}

.spirit-unit .unit-hud {
  min-width: 74px;
  max-width: 100px;
}

.spirit-unit .unit-stage em {
  position: absolute;
  right: 2px;
  bottom: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.battle-avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1.25 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
}

.battle-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.battle-avatar .sprite-frame {
  z-index: 1;
}

.battle-avatar em {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.32);
}

.spirit-companion {
  position: absolute;
  right: -18px;
  bottom: -2px;
  z-index: 2;
  width: 44px;
  min-width: 36px;
  max-width: 48px;
  pointer-events: none;
  filter: drop-shadow(0 0 12px rgba(255, 155, 92, 0.46));
}

.spirit-companion .sprite-spirit {
  width: 100%;
  aspect-ratio: 0.82 / 1;
}

.spirit-companion.active {
  animation: spirit-companion-cast 680ms ease-out both;
}

.battle-fx-strip {
  position: relative;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.battlefield > .battle-fx-strip {
  position: absolute;
  z-index: 8;
  left: 30%;
  right: 30%;
  top: 47%;
  transform: translateY(-50%);
  pointer-events: none;
}

.battlefield > .battle-fx-strip.idle {
  display: none;
}

.battle-fx-strip span {
  position: relative;
  z-index: 1;
  color: #ffe49a;
  font-weight: 800;
  letter-spacing: 0;
}

.battle-fx-strip i {
  position: absolute;
  left: 8%;
  top: 50%;
  width: 22%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ffe49a, transparent);
  box-shadow: 0 0 18px rgba(255, 228, 154, 0.55);
  transform: translateY(-50%);
  animation: projectile-x 520ms ease-out both;
}

.effect-sprite {
  --effect-url: none;
  position: absolute;
  z-index: 0;
  width: min(44%, 340px);
  height: 120px;
  background-image: var(--effect-url);
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-position: 0% 0%;
  opacity: 0.92;
  filter: drop-shadow(0 0 18px rgba(255, 228, 154, 0.44));
  animation: sprite-4x2-idle 620ms steps(1, end) both;
}

.unit-stage .unit-impact-fx {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 5;
  width: 150%;
  max-width: 150px;
  min-width: 86px;
  height: 92px;
  background-image: var(--effect-url);
  background-repeat: no-repeat;
  background-size: 400% 200%;
  background-position: 0% 0%;
  opacity: 0.96;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 16px rgba(255, 224, 126, 0.62));
  pointer-events: none;
  animation:
    sprite-4x2-idle 620ms steps(1, end) both,
    target-impact-pop 620ms ease-out both;
}

.unit-stage .unit-impact-fx.fx-heal,
.unit-stage .unit-impact-fx.fx-guard,
.unit-stage .unit-impact-fx.fx-haste {
  filter: drop-shadow(0 0 16px rgba(104, 226, 156, 0.62));
}

.unit-stage .unit-impact-fx.fx-enemy,
.unit-stage .unit-impact-fx.fx-boss {
  filter: drop-shadow(0 0 16px rgba(255, 122, 98, 0.68));
}

.unit-impact-flash {
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: 5;
  width: 74px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 158, 0.95), rgba(255, 134, 88, 0.35) 48%, transparent 72%);
  pointer-events: none;
  animation: target-impact-pop 520ms ease-out both;
}

.battle-fx-strip.fx-enemy .effect-sprite,
.battle-fx-strip.fx-boss .effect-sprite {
  transform: scaleX(-1);
}

.battle-fx-strip.fx-enemy i,
.battle-fx-strip.fx-boss i {
  left: auto;
  right: 8%;
  animation-name: projectile-x-reverse;
  background: linear-gradient(90deg, transparent, #ff7a62, transparent);
  box-shadow: 0 0 18px rgba(255, 122, 98, 0.62);
}

.battle-fx-strip.fx-heal i,
.battle-fx-strip.fx-guard i,
.battle-fx-strip.fx-haste i {
  width: 42%;
  left: 29%;
  background: linear-gradient(90deg, transparent, #68e29c, #7dd8ff, transparent);
  animation-name: pulse-line;
}

.battle-fx-strip.idle span {
  color: var(--muted);
}

.battle-fx-strip.idle i {
  display: none;
}

.battle-card.fx-source,
.battle-unit.fx-source .sprite-frame,
.battle-unit.fx-source .battle-sprite {
  border-color: rgba(255, 228, 154, 0.72);
  animation: unit-lunge 520ms ease-out both;
}

.enemy-card.fx-source,
.enemy-unit.fx-source .sprite-frame,
.enemy-unit.fx-source .battle-sprite {
  animation-name: enemy-lunge;
}

.battle-card.fx-target,
.battle-unit.fx-target .unit-stage {
  border-color: rgba(255, 122, 98, 0.72);
  animation: hit-flash 520ms ease-out both;
}

.battle-card.fx-heal.fx-target,
.battle-card.fx-guard.fx-target,
.battle-card.fx-haste.fx-target,
.battle-unit.fx-heal.fx-target .unit-stage,
.battle-unit.fx-guard.fx-target .unit-stage,
.battle-unit.fx-haste.fx-target .unit-stage {
  border-color: rgba(104, 226, 156, 0.72);
  animation-name: buff-pulse;
}

.battle-card.fx-spirit.fx-source::after,
.battle-unit.fx-spirit.fx-source .unit-stage::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 10px;
  border: 2px solid rgba(181, 140, 255, 0.72);
  box-shadow: 0 0 22px rgba(181, 140, 255, 0.44);
  animation: spirit-ring 620ms ease-out both;
  pointer-events: none;
}

.battle-unit.fx-spirit.fx-source .unit-stage::before {
  z-index: 4;
}

.float-number {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(24, 9, 7, 0.9);
  color: #ffd2c8;
  padding: 3px 8px;
  font-weight: 900;
  font-size: 13px;
  pointer-events: none;
  animation: float-number 780ms ease-out both;
}

.float-number.heal {
  background: rgba(7, 24, 16, 0.9);
  color: #b9ffd2;
}

.enemy-command {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.command-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(12, 16, 23, 0.84);
}

.command-panel.secondary-panel {
  border-color: rgba(127, 196, 232, 0.16);
  background: rgba(12, 16, 23, 0.74);
}

.battle-action-bar {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 12px;
  z-index: 12;
  border: 1px solid rgba(232, 193, 93, 0.24);
  border-radius: 8px;
  background: rgba(10, 13, 18, 0.86);
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.battle-action-topline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.battle-priority-pill {
  min-width: 0;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px;
}

.battle-priority-pill small,
.battle-priority-pill b,
.battle-priority-pill em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-style: normal;
}

.battle-priority-pill small {
  color: var(--muted);
  font-size: 10px;
}

.battle-priority-pill b {
  color: var(--text);
  font-size: 12px;
}

.battle-priority-pill em {
  color: var(--gold);
  font-size: 10px;
}

.battle-priority-pill.actor {
  border-color: rgba(141, 207, 138, 0.28);
  background: rgba(141, 207, 138, 0.07);
}

.battle-priority-pill.threat {
  border-color: rgba(240, 138, 120, 0.26);
  background: rgba(240, 138, 120, 0.07);
}

.battle-priority-pill.commit {
  border-color: rgba(232, 193, 93, 0.28);
  background: rgba(232, 193, 93, 0.08);
}

.battle-priority-pill.compact {
  gap: 1px;
  padding: 5px 6px;
}

.battle-priority-pill.compact small {
  font-size: 9px;
}

.battle-priority-pill.compact b {
  font-size: 11px;
}

.battle-priority-pill.compact em {
  font-size: 9px;
}

.battle-action-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.46fr);
  gap: 8px;
  align-items: stretch;
}

.battle-action-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.battle-command-state-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.battle-command-state-chip {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
}

.battle-command-state-chip small,
.battle-command-state-chip b,
.battle-command-state-chip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-style: normal;
}

.battle-command-state-chip small,
.battle-command-state-chip em {
  color: var(--muted);
  font-size: 9px;
}

.battle-command-state-chip b {
  color: var(--text);
  font-size: 11px;
}

.battle-command-state-chip.command-ready {
  border-color: rgba(141, 207, 138, 0.32);
  background: rgba(141, 207, 138, 0.08);
}

.battle-command-state-chip.command-ready b {
  color: #c8f2c0;
}

.battle-command-state-chip.command-wait {
  border-color: rgba(232, 193, 93, 0.28);
  background: rgba(232, 193, 93, 0.07);
}

.battle-command-state-chip.command-wait b {
  color: #f1d48a;
}

.battle-command-state-chip.command-locked {
  border-color: rgba(240, 138, 120, 0.28);
  background: rgba(240, 138, 120, 0.07);
}

.battle-command-state-chip.command-locked b {
  color: #f3b2a6;
}

.battle-command-state-chip.active {
  box-shadow: inset 0 0 0 1px rgba(89, 210, 255, 0.52);
}

.battle-command-state-chip.recommended:not(.active) {
  box-shadow: inset 0 0 0 1px rgba(141, 207, 138, 0.3);
}

.battle-mobile-brief {
  display: none;
  gap: 6px;
  min-width: 0;
}

.battle-mobile-brief > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px;
}

.battle-mobile-brief small,
.battle-mobile-brief b,
.battle-mobile-brief em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-style: normal;
}

.battle-mobile-brief small {
  color: var(--muted);
  font-size: 9px;
}

.battle-mobile-brief b {
  color: var(--text);
  font-size: 11px;
}

.battle-mobile-brief em {
  color: var(--gold);
  font-size: 9px;
}

.battle-mobile-brief.ready span {
  border-color: rgba(141, 207, 138, 0.22);
}

.battle-mobile-brief.fallback span {
  border-color: rgba(232, 193, 93, 0.24);
}

.battle-mobile-brief.wait span {
  border-color: rgba(240, 138, 120, 0.24);
}

.battle-mobile-control-summary {
  display: none;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.22);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.07);
  padding: 6px;
}

.battle-mobile-control-summary strong,
.battle-mobile-control-summary small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.22;
}

.battle-mobile-control-summary strong {
  color: var(--text);
  font-size: 10px;
}

.battle-mobile-control-summary small {
  color: var(--muted);
  font-size: 9px;
}

.battle-mobile-control-summary.policy-main {
  border-color: rgba(89, 210, 255, 0.26);
  background: rgba(89, 210, 255, 0.08);
}

.battle-mobile-control-summary.policy-main strong {
  color: var(--cyan);
}

.battle-mobile-control-summary.policy-ok {
  border-color: rgba(141, 207, 138, 0.28);
  background: rgba(141, 207, 138, 0.08);
}

.battle-mobile-control-summary.policy-ok strong {
  color: #a8e6a3;
}

.battle-mobile-control-summary.policy-locked {
  border-color: rgba(232, 193, 93, 0.26);
  background: rgba(232, 193, 93, 0.09);
}

.battle-mobile-control-summary.policy-locked strong {
  color: var(--gold);
}

.battle-mobile-next-step {
  display: none;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 7px 8px;
}

.battle-mobile-next-step small,
.battle-mobile-next-step strong,
.battle-mobile-next-step em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.22;
  font-style: normal;
}

.battle-mobile-next-step small {
  color: var(--muted);
  font-size: 9px;
}

.battle-mobile-next-step strong {
  color: var(--text);
  font-size: 11px;
}

.battle-mobile-next-step em {
  color: var(--gold);
  font-size: 9px;
}

.battle-mobile-next-step.ready {
  border-color: rgba(141, 207, 138, 0.32);
  background: rgba(141, 207, 138, 0.08);
}

.battle-mobile-next-step.ready strong {
  color: #c8f2c0;
}

.battle-mobile-next-step.fallback {
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.1);
}

.battle-mobile-next-step.fallback strong {
  color: #f1d48a;
}

.battle-mobile-next-step.wait {
  border-color: rgba(240, 138, 120, 0.3);
  background: rgba(240, 138, 120, 0.08);
}

.battle-mobile-next-step.wait strong {
  color: #f3b2a6;
}

.battle-selection-hint {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 7px;
}

.battle-selection-hint strong,
.battle-selection-hint small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.24;
}

.battle-selection-hint strong {
  color: var(--text);
  font-size: 11px;
}

.battle-selection-hint small {
  color: var(--muted);
  font-size: 9px;
}

.battle-selection-hint.locked {
  border-color: rgba(240, 138, 120, 0.3);
  background: rgba(240, 138, 120, 0.08);
}

.battle-selection-hint.locked strong {
  color: #f3b2a6;
}

.battle-selection-hint-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.battle-selection-hint-actions button {
  min-width: 0;
  min-height: 36px;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 6px;
}

.battle-selection-hint-actions button small,
.battle-selection-hint-actions button b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.battle-selection-hint-actions button small {
  color: var(--muted);
  font-size: 9px;
}

.battle-selection-hint-actions button b {
  color: var(--text);
  font-size: 10px;
}

.battle-action-drawer {
  grid-column: 1 / -1;
}

.battle-action-focus {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 7px 8px;
}

.battle-action-focus strong,
.battle-action-focus small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.battle-action-focus strong {
  color: var(--text);
  font-size: 12px;
}

.battle-action-focus small {
  color: var(--muted);
  font-size: 10px;
}

.battle-action-focus.ready {
  border-color: rgba(141, 207, 138, 0.35);
  background: rgba(141, 207, 138, 0.08);
}

.battle-action-focus.ready strong {
  color: #c8f2c0;
}

.battle-action-focus.fallback {
  border-color: rgba(232, 193, 93, 0.34);
  background: rgba(232, 193, 93, 0.1);
}

.battle-action-focus.fallback strong {
  color: #f1d48a;
}

.battle-action-focus.wait {
  border-color: rgba(240, 138, 120, 0.3);
  background: rgba(240, 138, 120, 0.08);
}

.battle-action-focus.wait strong {
  color: #f3b2a6;
}

.battle-action-summary span {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px;
}

.battle-action-summary small,
.battle-action-summary b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.24;
}

.battle-action-summary small {
  color: var(--muted);
  font-size: 10px;
}

.battle-action-summary b {
  color: var(--text);
  font-size: 12px;
}

.quick-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.quick-command-grid button {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  padding: 6px;
  text-align: left;
}

.quick-command-grid button b,
.quick-command-grid button small {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.14;
}

.quick-command-grid button b {
  font-size: 11px;
}

.quick-command-grid button small {
  color: var(--muted);
  font-size: 8px;
}

.quick-command-grid button.command-ready small {
  color: var(--green);
}

.quick-command-grid button.command-wait small {
  color: var(--gold);
}

.quick-command-grid button.command-locked small {
  color: #f08a78;
}

.quick-command-grid button.active {
  border-color: rgba(232, 193, 93, 0.72);
  background: rgba(232, 193, 93, 0.16);
}

.quick-command-grid button.recommended {
  border-color: rgba(141, 207, 138, 0.66);
  box-shadow: 0 0 0 1px rgba(141, 207, 138, 0.16);
}

.quick-command-grid button.recommended::after {
  content: "建議";
  position: absolute;
  right: 4px;
  top: -7px;
  border: 1px solid rgba(141, 207, 138, 0.42);
  border-radius: 7px;
  background: rgba(8, 12, 18, 0.94);
  color: #a2dda0;
  padding: 1px 4px;
  font-size: 8px;
  line-height: 1.1;
}

.battle-primary-action {
  width: 100%;
  min-height: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.battle-action-commit {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.battle-action-commit small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.battle-control-switch-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.battle-control-switch-row button {
  min-width: 0;
  min-height: 38px;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 6px;
}

.battle-control-switch-row button small,
.battle-control-switch-row button b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.battle-control-switch-row button small {
  color: var(--muted);
  font-size: 9px;
}

.battle-control-switch-row button b {
  color: var(--text);
  font-size: 10px;
}

.battle-control-switch-row button.active {
  border-color: rgba(127, 196, 232, 0.72);
  background: rgba(127, 196, 232, 0.16);
}

.battle-control-policy-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.battle-control-policy-strip span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
}

.battle-control-policy-strip small,
.battle-control-policy-strip b,
.battle-control-policy-strip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.22;
}

.battle-control-policy-strip small,
.battle-control-policy-strip em {
  color: var(--muted);
  font-size: 9px;
}

.battle-control-policy-strip b {
  color: var(--cyan);
  font-size: 11px;
}

.battle-control-policy-strip .policy-ok {
  border-color: rgba(141, 207, 138, 0.3);
  background: rgba(141, 207, 138, 0.07);
}

.battle-control-policy-strip .policy-ok b {
  color: #a8e6a3;
}

.battle-control-policy-strip .policy-main {
  border-color: rgba(89, 210, 255, 0.3);
  background: rgba(89, 210, 255, 0.06);
}

.battle-control-policy-strip .policy-locked {
  border-color: rgba(232, 193, 93, 0.24);
  background: rgba(232, 193, 93, 0.055);
}

.battle-control-policy-strip .policy-locked b {
  color: var(--gold);
}

.battle-control-roster-drawer {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 7px;
}

.battle-control-roster-group {
  display: grid;
  gap: 6px;
}

.battle-control-roster-group + .battle-control-roster-group {
  margin-top: 8px;
}

.battle-control-roster-group > strong {
  color: var(--text);
  font-size: 11px;
}

.battle-control-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
}

.battle-control-roster-chip {
  min-width: 0;
  min-height: 48px;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 6px;
}

.battle-control-roster-chip small,
.battle-control-roster-chip b,
.battle-control-roster-chip em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
  font-style: normal;
}

.battle-control-roster-chip small,
.battle-control-roster-chip em {
  color: var(--muted);
  font-size: 9px;
}

.battle-control-roster-chip b {
  color: var(--text);
  font-size: 11px;
}

.battle-control-roster-chip.main {
  border-color: rgba(127, 196, 232, 0.72);
  background: rgba(127, 196, 232, 0.12);
}

.battle-control-roster-chip.main b {
  color: var(--cyan);
}

.battle-control-roster-chip.selected:not(.main) {
  border-color: rgba(232, 193, 93, 0.56);
  background: rgba(232, 193, 93, 0.08);
}

.battle-pace-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.command-panel > .battle-pace-controls {
  grid-column: auto;
}

.battle-pace-controls button {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  min-height: 38px;
  padding: 6px;
  text-align: left;
}

.battle-pace-controls button b,
.battle-pace-controls button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.battle-pace-controls button b {
  font-size: 11px;
}

.battle-pace-controls button small {
  color: var(--muted);
  font-size: 9px;
}

.battle-pace-controls button.active {
  border-color: rgba(232, 193, 93, 0.68);
  background: rgba(232, 193, 93, 0.14);
  color: var(--gold);
}

.battle-target-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(120px, 0.22fr) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.battle-target-focus {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.battle-target-mobile-rail {
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.battle-target-mobile-summary {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px;
}

.battle-target-strip.notice {
  grid-template-columns: minmax(0, 1fr);
}

.battle-control-hints {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
}

.battle-control-chip {
  min-width: 0;
  border: 1px solid rgba(127, 196, 232, 0.18);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.05);
  padding: 6px;
}

.battle-control-chip small,
.battle-control-chip b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.battle-control-chip small {
  color: var(--muted);
  font-size: 9px;
}

.battle-control-chip b {
  color: var(--text);
  font-size: 10px;
}

.battle-target-label,
.battle-target-mobile-summary,
.battle-target-chip-row button {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px;
}

.battle-target-label small,
.battle-target-label b,
.battle-target-label em,
.battle-target-mobile-summary small,
.battle-target-mobile-summary b,
.battle-target-mobile-summary em,
.battle-target-chip-row button b,
.battle-target-chip-row button small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.battle-target-label small,
.battle-target-label em,
.battle-target-mobile-summary small,
.battle-target-mobile-summary em,
.battle-target-chip-row button small {
  color: var(--muted);
  font-size: 9px;
}

.battle-target-label b,
.battle-target-mobile-summary b,
.battle-target-chip-row button b {
  color: var(--text);
  font-size: 11px;
}

.battle-target-cycle-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.battle-target-cycle-controls button {
  min-height: 34px;
  padding: 5px 6px;
  font-size: 10px;
}

.battle-target-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 6px;
  min-width: 0;
}

.battle-target-mobile-drawer {
  display: none;
  grid-column: 1 / -1;
}

.battle-target-mobile-body {
  display: grid;
  gap: 6px;
}

.mobile-target-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.battle-target-chip-row button {
  min-height: 42px;
  text-align: left;
}

.battle-target-chip-row button.selected {
  border-color: rgba(232, 193, 93, 0.68);
  background: rgba(232, 193, 93, 0.14);
}

.battle-target-chip-row button.recommended:not(.selected) {
  border-color: rgba(141, 207, 138, 0.52);
  background: rgba(141, 207, 138, 0.07);
}

.command-panel .inline-row button {
  min-width: 132px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.command-panel > .inline-row {
  justify-content: center;
}

.battle-threat-drawer,
.command-detail-drawer,
.battle-settings-drawer,
.battle-mobile-drawer {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 7px;
}

.battle-threat-drawer > summary strong,
.command-detail-drawer > summary strong,
.battle-settings-drawer > summary strong,
.battle-mobile-drawer > summary strong {
  color: var(--text);
  font-size: 12px;
}

.battle-threat-drawer > summary .tag,
.command-detail-drawer > summary .tag,
.battle-settings-drawer > summary .tag,
.battle-mobile-drawer > summary .tag {
  max-width: 70%;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: right;
}

.battle-mobile-drawer {
  display: none;
}

.battle-mobile-drawer-body {
  display: grid;
  gap: 8px;
}

.battle-bottom-bar {
  display: none;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mode-row button.active {
  border-color: rgba(232, 193, 93, 0.72);
  background: rgba(232, 193, 93, 0.16);
}

.battle-secondary-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid rgba(127, 196, 232, 0.18);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.05);
  padding: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.battle-secondary-note strong {
  color: var(--text);
}

.battle-secondary-note .tag {
  margin-left: auto;
}

.auto-setting-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(127, 196, 232, 0.18);
  border-radius: 8px;
  background: rgba(127, 196, 232, 0.045);
  padding: 7px;
}

.auto-setting-row label {
  display: grid;
  grid-template-columns: auto minmax(120px, 220px) auto;
  gap: 8px;
  align-items: center;
}

.auto-setting-row input {
  min-height: 0;
  padding: 0;
}

.auto-setting-row span,
.auto-setting-row small {
  color: var(--muted);
  font-size: 11px;
}

.auto-setting-row b {
  color: var(--cyan);
  font-size: 12px;
}

.command-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.command-status-strip > span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px;
}

.command-status-strip small,
.command-status-strip b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.command-status-strip small {
  color: var(--muted);
  font-size: 10px;
}

.command-status-strip b {
  color: var(--cyan);
  font-size: 12px;
}

.battle-hud-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.battle-settings-drawer .battle-hud-legend {
  margin-top: 8px;
}

.battle-hud-legend span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.12;
  white-space: nowrap;
}

.battle-hud-legend i {
  width: 14px;
  height: 4px;
  border-radius: 999px;
  background: var(--green);
}

.battle-hud-legend .legend-resource i {
  background: #65a8ff;
}

.battle-hud-legend .legend-energy i {
  background: var(--gold);
}

.battle-hud-legend .legend-atb i {
  background: linear-gradient(90deg, #f2c65d, #ff8d5f);
}

.battle-hud-legend .legend-cooldown i {
  background: linear-gradient(90deg, #73ead9, #7ea7ff);
}

.command-decision-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.command-decision-strip span {
  min-width: 0;
  border: 1px solid rgba(141, 207, 138, 0.24);
  border-radius: 8px;
  background: rgba(141, 207, 138, 0.06);
  padding: 6px;
}

.command-decision-strip small,
.command-decision-strip b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.command-decision-strip small {
  color: var(--muted);
  font-size: 10px;
}

.command-decision-strip b {
  color: var(--green);
  font-size: 12px;
}

.battle-fit-strip {
  display: grid;
  grid-template-columns: minmax(86px, 0.34fr) minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(141, 207, 138, 0.22);
  border-radius: 8px;
  background: rgba(141, 207, 138, 0.055);
  padding: 6px;
}

.battle-fit-label {
  display: block;
  min-width: 0;
}

.battle-fit-label small,
.battle-fit-label b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.battle-fit-label small {
  color: var(--muted);
  font-size: 10px;
}

.battle-fit-label b {
  color: var(--green);
  font-size: 11px;
}

.battle-fit-strip .unit-fit-tags {
  min-width: 0;
}

.command-threat-plan {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.command-threat-plan span {
  min-width: 0;
  border: 1px solid rgba(232, 193, 93, 0.24);
  border-radius: 8px;
  background: rgba(232, 193, 93, 0.06);
  padding: 6px;
}

.command-threat-plan small,
.command-threat-plan b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.command-threat-plan small {
  color: var(--muted);
  font-size: 10px;
}

.command-threat-plan b {
  color: var(--gold);
  font-size: 12px;
}

.tactic-hints {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.4fr);
  gap: 8px;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.66);
  padding: 8px;
}

.tactic-priority {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 7px;
  min-width: 0;
}

.tactic-priority > b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  border-radius: 7px;
  background: #e8c15d;
  color: #11151c;
  font-size: 12px;
  line-height: 1;
}

.tactic-hints.intent-debuff .tactic-priority > b {
  background: #d66f5c;
}

.tactic-hints.intent-tempo .tactic-priority > b {
  background: #7fc4e8;
}

.tactic-hints.intent-guard .tactic-priority > b {
  background: #8dcf8a;
}

.tactic-hints.intent-boss .tactic-priority > b {
  background: #e06060;
  color: #fff;
}

.tactic-priority strong,
.tactic-priority small,
.tactic-priority i {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.tactic-priority strong {
  color: var(--text);
  font-size: 12px;
}

.tactic-priority small {
  color: var(--muted);
  font-size: 10px;
}

.tactic-priority i {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.tactic-priority i.pressure-critical {
  color: #f08a78;
}

.tactic-priority i.pressure-high {
  color: var(--gold);
}

.tactic-counter-row {
  align-content: center;
}

.battle-skill-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.battle-skill-row .skill-book-pill {
  background: rgba(255, 255, 255, 0.045);
}

.battle-skill-row .skill-slot-role {
  color: var(--green);
  font-weight: 800;
}

.battle-skill-row .skill-slot-state {
  color: var(--cyan);
  font-weight: 800;
}

.battle-skill-row .skill-element-state {
  font-weight: 900;
}

.battle-skill-row .skill-element-state.element-bonus-active {
  color: var(--green);
}

.battle-skill-row .skill-element-state.element-bonus-dormant {
  color: var(--gold);
}

.battle-skill-row .skill-element-state.element-bonus-empty {
  color: var(--muted);
}

.battle-skill-row .skill-book-pill.empty .skill-slot-role {
  color: var(--muted);
}

.battle-skill-row .ultimate-pill {
  grid-column: 1 / -1;
  border-color: rgba(232, 193, 93, 0.42);
  background: rgba(232, 193, 93, 0.08);
}

.battle-skill-row .spirit-only {
  grid-column: 1 / -1;
  border-color: rgba(181, 140, 255, 0.45);
}

.queue {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.queue span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.queue span.now {
  color: #ffe49a;
  border-color: rgba(232, 193, 93, 0.5);
}

.queue span.selected {
  color: #fff;
  border-color: rgba(101, 168, 255, 0.6);
}

.atb-lane span {
  display: grid;
  gap: 4px;
  min-width: 104px;
}

.atb-lane strong,
.atb-lane small {
  display: block;
  min-width: 0;
  max-width: 128px;
  overflow: hidden;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atb-lane strong {
  color: var(--text);
  font-size: 11px;
}

.atb-lane small {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
}

.atb-lane i {
  display: block;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.atb-lane i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2c65d, #ff8d5f);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 8, 0.72);
  z-index: 20;
  padding: 14px;
}

.modal-card {
  width: min(720px, 100%);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.npc-dialogue {
  display: grid;
  gap: 8px;
}

.npc-modal-hero {
  display: grid;
  grid-template-columns: minmax(108px, 132px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.npc-modal-portrait {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(89, 210, 255, 0.12), rgba(232, 193, 93, 0.08));
}

.npc-modal-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(8, 12, 18, 0.34);
}

.npc-modal-hero-copy {
  display: grid;
  gap: 4px;
}

.npc-modal-hero-copy strong,
.npc-modal-hero-copy small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.npc-modal-hero-copy small {
  color: var(--muted);
  line-height: 1.45;
}

.dialogue-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.58;
}

.npc-safety-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
}

.npc-quest-brief-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
}

.npc-quest-brief-strip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 2px;
}

.npc-quest-brief-strip small {
  color: var(--muted);
  font-size: 10px;
}

.npc-quest-brief-strip b {
  font-size: 11px;
  line-height: 1.4;
}

.npc-safety-strip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 2px;
}

.npc-safety-strip small {
  color: var(--muted);
  font-size: 10px;
}

.npc-safety-strip b {
  font-size: 12px;
}

.npc-quest-next-step {
  margin: 10px 0 0;
  color: var(--muted);
}

.npc-quest-guidance-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
}

.npc-quest-guidance-strip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 2px;
}

.npc-quest-guidance-strip small {
  color: var(--muted);
  font-size: 10px;
}

.npc-quest-guidance-strip b {
  font-size: 11px;
  line-height: 1.4;
}

.npc-quest-next-copy {
  margin: 0;
}

.npc-modal-drawer {
  display: grid;
  gap: 8px;
}

.npc-modal-drawer > summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.npc-modal-drawer > summary .tag {
  flex-shrink: 0;
}

.npc-topic-strip {
  display: grid;
  gap: 6px;
}

.npc-topic-strip > small {
  color: var(--muted);
  font-size: 10px;
}

.npc-topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.npc-topic-chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(89, 210, 255, 0.28);
  background: rgba(89, 210, 255, 0.08);
  color: #d9f5ff;
}

.npc-topic-chip:hover {
  border-color: rgba(232, 193, 93, 0.42);
  background: linear-gradient(135deg, rgba(232, 193, 93, 0.14), rgba(89, 210, 255, 0.08));
}

.npc-dialogue .inline-row button.quest-next-action {
  border-color: rgba(232, 193, 93, 0.48);
  background: linear-gradient(135deg, rgba(232, 193, 93, 0.18), rgba(89, 210, 255, 0.08));
  color: #fff3c4;
}

.small {
  font-size: 12px;
  line-height: 1.45;
}

.hide {
  display: none !important;
}

@media (max-width: 980px) {
  .layout,
  .map-frame {
    grid-template-columns: 1fr;
  }

  .team-grid,
  .spirit-grid,
  .battle-row,
  .skill-role-grid,
  .common-list,
  .monster-audit-strip,
  .monster-balance-grid,
  .monster-codex-grid,
  .equipment-branch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-decision-strip,
  .skill-rule-grid,
  .skill-guide-grid,
  .equipment-rule-grid,
  .battle-skill-row,
  .progression-panel,
  .map-drop-grid,
  .role-relation-grid,
  .stat-allocator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quality-strip,
  .skill-route-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-grid {
    min-height: 360px;
  }

  .battlefield {
    min-height: 520px;
  }

  .battle-action-bar {
    grid-template-columns: 1fr;
  }

  .battle-action-topline,
  .battle-action-main {
    grid-template-columns: 1fr;
  }

  .battle-command-state-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-primary-action {
    min-height: 42px;
  }

  .battle-unit {
    width: 74px;
  }

  .unit-hud {
    min-width: 76px;
    max-width: 104px;
  }

  .sprite-ally,
  .sprite-enemy {
    width: 72px;
  }

  .spirit-companion {
    width: 34px;
    right: -12px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .topbar-side {
    justify-items: stretch;
  }

  .brand h1 {
    font-size: 22px;
  }

  .resource-row {
    gap: 6px;
  }

  .shell-status-row {
    justify-content: flex-start;
    gap: 6px;
  }

  .resource-pill {
    padding: 3px 7px;
    font-size: 11px;
  }

  .shell-install-button {
    width: 100%;
  }

  .tab-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .tab-row button {
    min-width: 0;
    min-height: 38px;
    padding: 7px 5px;
  }

  .tab-button-with-icon {
    gap: 4px;
  }

  .equipment-tool-tabs {
    gap: 6px;
  }

  .runtime-contract-icon-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .team-grid,
  .spirit-grid,
  .skill-role-grid,
  .skill-rule-grid,
  .skill-guide-grid,
  .battle-action-summary,
  .command-status-strip,
  .command-decision-strip,
  .command-threat-plan,
  .readiness-plan-strip,
  .equipment-rule-grid,
  .equipment-branch-grid,
  .common-list,
  .battle-skill-row,
  .stat-allocator-grid,
  .inventory-grid,
  .equipment-picker-grid,
  .asset-hook-grid,
  .monster-audit-strip,
  .monster-balance-grid,
  .monster-codex-grid {
    grid-template-columns: 1fr;
  }

  .battle-row {
    grid-template-columns: 1fr;
  }

  .asset-preview-columns,
  .asset-story-strip,
  .asset-effect-grid,
  .monster-codex-grid {
    grid-template-columns: 1fr;
  }

  .skill-element-selector {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skill-element-selector button {
    min-height: 40px;
  }

  .asset-hook-head {
    display: grid;
    gap: 4px;
    justify-content: stretch;
  }

  .branch-pill-grid {
    grid-template-columns: 1fr;
  }

  .auto-setting-row label {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .party-row-control {
    grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
    align-items: center;
  }

  .auto-policy-strip,
  .spirit-control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .char-card .portrait,
  .spirit-card .spirit-portrait {
    height: 112px;
    min-height: 112px;
  }

  .spirit-cutout {
    max-height: 112px;
    padding: 5px;
  }

  .portrait img {
    padding: 5px;
  }

  .tactic-hints {
    grid-template-columns: 1fr;
  }

  .world-stage-grid,
  .progression-panel,
  .quality-strip,
  .map-drop-grid,
  .skill-route-grid,
  .role-relation-grid {
    grid-template-columns: 1fr;
  }

  .map-grid {
    grid-template-columns: repeat(14, minmax(18px, 1fr));
    gap: 2px;
    padding: 5px;
    min-height: clamp(280px, 39svh, 340px);
  }

  .tile {
    min-height: 20px;
  }

  .map-panel {
    padding: 9px;
  }

  .map-panel .panel-title {
    margin-bottom: 7px;
  }

  .map-panel .panel-title h2 {
    font-size: 18px;
  }

  .map-panel .panel-title p {
    margin-top: 2px;
    font-size: 11px;
  }

  .map-objective-panel {
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
  }

  .map-objective-panel .quest-action-strip {
    grid-template-columns: 1fr;
  }

  .map-objective-panel .small {
    margin: 0;
  }

  .map-quick-panel {
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
  }

  .map-quick-grid {
    grid-template-columns: 1fr;
  }

  .map-quick-card {
    gap: 5px;
    padding: 7px;
  }

  .map-quick-card p {
    font-size: 10px;
  }

  .objective-proof-strip,
  .objective-action-row {
    grid-template-columns: 1fr;
  }

  .battlefield {
    min-height: clamp(280px, 34svh, 330px);
  }

  .battle-scene {
    gap: 7px;
    padding: 7px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .quest-current-rail {
    padding: 8px;
  }

  .quest-current-summary {
    grid-template-columns: 1fr;
  }

  .stage-visual-preview,
  .npc-modal-hero {
    grid-template-columns: 1fr;
  }

  .chapter-monster-preview-strip {
    grid-template-columns: 1fr 1fr;
  }

  .chapter-generated-asset-head {
    display: grid;
    gap: 4px;
  }

  .chapter-generated-asset-head small {
    text-align: left;
  }

  .chapter-stage-asset-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-monster-asset-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .battle-action-bar {
    position: sticky;
    top: 8px;
    z-index: 12;
    padding: 7px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  }

  .battle-action-topline {
    display: none;
  }

  .battle-mobile-brief {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .battle-mobile-brief > span:last-child {
    grid-column: 1 / -1;
  }

  .quick-command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-action-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .battle-action-commit {
    order: -1;
  }

  .battle-action-commit small {
    display: none;
  }

  .battle-command-state-strip {
    display: none;
  }

  .battle-pace-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-target-strip {
    grid-template-columns: 1fr;
  }

  .battle-target-mobile-rail {
    display: grid;
  }

  .battle-target-focus {
    display: none;
  }

  .battle-target-chip-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-command-grid button {
    min-height: 38px;
  }

  .battle-target-chip-row button {
    min-height: 38px;
    padding: 5px;
  }

  .quick-command-grid button b,
  .quick-command-grid button small {
    white-space: normal;
  }

  .battle-primary-action {
    min-height: 40px;
    font-size: 11px;
    line-height: 1.18;
  }

  .battle-action-drawer {
    display: none;
  }

  .battle-action-focus {
    display: none;
  }

  .battle-mobile-next-step {
    display: grid;
    order: -2;
    padding: 6px 7px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  }

  .battle-mobile-next-step strong {
    font-size: 10px;
  }

  .battle-mobile-next-step em {
    font-size: 9px;
  }

  .battle-selection-hint {
    display: grid;
    order: -1;
    border-width: 1px;
    padding: 7px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  }

  .battle-selection-hint strong {
    font-size: 10px;
  }

  .battle-selection-hint small {
    font-size: 9px;
  }

  .battle-selection-hint-actions {
    grid-template-columns: 1fr;
  }

  .battle-control-hints {
    display: none;
  }

  .battle-priority-pill {
    padding: 5px 6px;
  }

  .battle-priority-pill b {
    font-size: 11px;
  }

  .battle-priority-pill em {
    font-size: 9px;
  }

  .battle-action-commit small,
  .battle-action-focus small {
    font-size: 9px;
    line-height: 1.22;
  }

  .battle-mobile-brief > span {
    padding: 5px;
  }

  .battle-mobile-brief b,
  .battle-mobile-brief em {
    font-size: 9px;
  }

  .battle-mobile-drawer {
    display: block;
    grid-column: 1 / -1;
  }

  .battle-control-policy-strip {
    display: none;
  }

  .battle-control-roster-grid {
    grid-template-columns: 1fr;
  }

  .battle-mobile-control-summary {
    display: grid;
    order: -1;
  }

  .battle-control-chip b {
    font-size: 9px;
  }

  .battle-bottom-bar {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 13;
    display: grid;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(10, 13, 18, 0.94);
    padding: 7px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
  }

  .battle-bottom-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .battle-bottom-summary > span {
    min-width: 0;
    display: grid;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 6px;
  }

  .battle-bottom-summary small,
  .battle-bottom-summary b {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.2;
  }

  .battle-bottom-summary small {
    color: var(--muted);
    font-size: 9px;
  }

  .battle-bottom-summary b {
    color: var(--text);
    font-size: 10px;
  }

  .battle-bottom-actions {
    display: grid;
    gap: 6px;
  }

  .battle-bottom-bar .battle-control-switch-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .battle-bottom-bar .battle-control-switch-row button {
    min-height: 36px;
    padding: 6px;
  }

  .battle-bottom-bar .battle-control-switch-row button small,
  .battle-bottom-bar .battle-control-switch-row button b {
    line-height: 1.15;
  }

  .battle-bottom-bar .battle-control-switch-row button small {
    font-size: 9px;
  }

  .battle-bottom-bar .battle-control-switch-row button b {
    font-size: 10px;
  }

  .battle-bottom-note {
    display: grid;
    gap: 2px;
    margin: 0;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 6px;
  }

  .battle-bottom-note strong,
  .battle-bottom-note small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.18;
  }

  .battle-bottom-note strong {
    color: var(--text);
    font-size: 10px;
  }

  .battle-bottom-note small {
    color: var(--muted);
    font-size: 9px;
  }

  .battle-bottom-command-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .battle-bottom-primary {
    min-height: 42px;
  }

  .battle-bottom-bar.ready {
    border-color: rgba(141, 207, 138, 0.36);
  }

  .battle-bottom-bar.ready .battle-bottom-note {
    border-color: rgba(141, 207, 138, 0.24);
    background: rgba(141, 207, 138, 0.08);
  }

  .battle-bottom-bar.fallback {
    border-color: rgba(232, 193, 93, 0.38);
  }

  .battle-bottom-bar.fallback .battle-bottom-note {
    border-color: rgba(232, 193, 93, 0.24);
    background: rgba(232, 193, 93, 0.09);
  }

  .battle-bottom-bar.wait {
    border-color: rgba(240, 138, 120, 0.34);
  }

  .battle-bottom-bar.wait .battle-bottom-note {
    border-color: rgba(240, 138, 120, 0.22);
    background: rgba(240, 138, 120, 0.09);
  }

  .battle-action-bar .battle-control-switch-row {
    display: none;
  }

  .battle-target-chip-row {
    display: none;
  }

  .battle-target-mobile-drawer {
    display: block;
  }

  .battle-target-mobile-drawer .battle-target-chip-row {
    display: grid;
  }

  .battle-target-mobile-rail button {
    min-width: 52px;
    min-height: 34px;
    padding: 5px 4px;
    font-size: 9px;
  }

  .battle-target-mobile-summary {
    padding: 5px;
  }

  .battle-target-mobile-summary b,
  .battle-target-mobile-summary em {
    font-size: 9px;
  }

  .battle-target-cycle-controls button {
    min-height: 32px;
    font-size: 9px;
  }

  .battle-scene > .command-panel:not(.enemy-command) {
    display: none;
  }

  .battle-scene > .event-log {
    max-height: 72px;
    padding: 6px;
  }

  .battle-unit {
    width: 60px;
    min-height: 96px;
  }

  .unit-hud {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    padding: 3px 4px;
    overflow: hidden;
  }

  .unit-hud strong,
  .unit-hud span,
  .unit-intent {
    font-size: 9px;
  }

  .unit-hud strong,
  .unit-hud span,
  .enemy-unit .enemy-hud-hint {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .enemy-unit .unit-intent {
    display: none;
  }

  .character-unit .unit-hud > .character-hud-branch,
  .spirit-unit .unit-hud > .spirit-hud-control {
    display: none;
  }

  .sprite-ally,
  .sprite-enemy {
    width: 58px;
  }

  .battle-gear-icon {
    width: 13px;
    height: 13px;
    border-radius: 4px;
  }

  .battle-gear-icon .runtime-asset-glyph,
  .battle-gear-icon .runtime-asset-glyph-fallback {
    font-size: 8px;
  }

  .battle-gear-roster {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 4px;
    border-radius: 8px;
  }

  .battle-gear-context {
    font-size: 8px;
  }

  .battle-gear-roster .battle-gear-overlay {
    min-width: 0;
  }

  .battle-gear-owner {
    display: block;
    font-size: 8px;
    line-height: 1.05;
  }

  .battle-gear-owner-full {
    display: none;
  }

  .battle-gear-owner-short {
    display: inline;
  }

  .battle-gear-icons {
    gap: 1px;
    padding: 1px;
  }

  .battle-gear-icon::after {
    min-width: 6px;
    height: 6px;
    font-size: 5px;
  }

  .spirit-companion {
    width: 28px;
    right: -10px;
  }

  .battlefield > .battle-fx-strip {
    left: 18%;
    right: 18%;
  }
}

@media (max-height: 900px) and (min-width: 561px) {
  .battle-panel {
    padding: 10px;
  }

  .battle-panel .panel-title {
    margin-bottom: 8px;
  }

  .battle-panel .panel-title h2 {
    font-size: 18px;
  }

  .battle-scene {
    gap: 8px;
    padding: 8px;
  }

  .battlefield {
    min-height: clamp(320px, 42svh, 420px);
  }

  .battle-action-bar {
    gap: 6px;
    top: 8px;
    padding: 7px;
  }

  .battle-action-topline {
    display: none;
  }

  .battle-command-state-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-control-policy-strip,
  .battle-control-hints {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .battle-scene > .event-log {
    max-height: 84px;
  }
}

@keyframes projectile-x {
  0% {
    opacity: 0;
    transform: translate(-20%, -50%) scaleX(0.2);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(260%, -50%) scaleX(1);
  }
}

@keyframes projectile-x-reverse {
  0% {
    opacity: 0;
    transform: translate(20%, -50%) scaleX(0.2);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-260%, -50%) scaleX(1);
  }
}

@keyframes pulse-line {
  0% {
    opacity: 0;
    transform: translateY(-50%) scaleX(0.2);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) scaleX(1.16);
  }
}

@keyframes unit-lunge {
  0%, 100% {
    transform: translateX(0) scaleX(-1) scale(1);
  }
  42% {
    transform: translateX(-12px) scaleX(-1) scale(1.03);
  }
}

@keyframes enemy-lunge {
  0%, 100% {
    transform: translateX(0) scaleX(-1) scale(1);
  }
  42% {
    transform: translateX(12px) scaleX(-1) scale(1.03);
  }
}

@keyframes hit-flash {
  0%, 100% {
    filter: none;
  }
  28% {
    filter: brightness(1.75) saturate(1.35);
    transform: translateX(-4px);
  }
  52% {
    transform: translateX(4px);
  }
}

@keyframes blocked-tile-bump {
  0%, 100% {
    filter: brightness(1);
  }

  45% {
    filter: brightness(1.5) saturate(1.35);
  }
}

@keyframes buff-pulse {
  0%, 100% {
    filter: none;
  }
  45% {
    filter: brightness(1.55) saturate(1.25);
    box-shadow: 0 0 0 2px rgba(104, 226, 156, 0.24), 0 0 24px rgba(104, 226, 156, 0.22);
  }
}

@keyframes target-impact-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.58);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -54%) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(1.16);
  }
}

@keyframes spirit-ring {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes sprite-4x2-idle {
  0%,
  12.49% {
    background-position: 0% 0%;
  }
  12.5%,
  24.99% {
    background-position: 33.333% 0%;
  }
  25%,
  37.49% {
    background-position: 66.666% 0%;
  }
  37.5%,
  49.99% {
    background-position: 100% 0%;
  }
  50%,
  62.49% {
    background-position: 0% 100%;
  }
  62.5%,
  74.99% {
    background-position: 33.333% 100%;
  }
  75%,
  87.49% {
    background-position: 66.666% 100%;
  }
  87.5%,
  100% {
    background-position: 100% 100%;
  }
}

@keyframes spirit-companion-cast {
  0% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-14px) scale(1.14);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes float-number {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.9);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -30px) scale(1.08);
  }
}
