/* Forest Frontier v0.12.1 hotfix.
 * - GPU-only attack meter movement.
 * - Fixed combat-card tracks on mobile and desktop mobile emulation.
 * - Compact Outpost commission cards matching Patrol scale.
 */

.attack-meter-marker {
  left: 0 !important;
  transform: translate3d(0,0,0);
  transition: none !important;
  will-change: transform;
  contain: paint;
  backface-visibility: hidden;
}

@media (max-width: 767px) {
  body.theme-ashen.screen-battle-active .battle-stage {
    align-items: stretch !important;
  }

  body.theme-ashen.screen-battle-active .battle-stage .combatant {
    height: 272px !important;
    min-height: 272px !important;
    max-height: 272px !important;
    overflow: hidden !important;
    contain: size layout paint;
  }

  body.theme-ashen.screen-battle-active .battle-stage .combatant-hero {
    grid-template-rows: 43px minmax(0,1fr) 48px !important;
  }

  body.theme-ashen.screen-battle-active .battle-stage .combatant-enemy {
    grid-template-rows: 58px minmax(0,1fr) 29px 66px !important;
  }

  body.theme-ashen.screen-battle-active .hero-card-header,
  body.theme-ashen.screen-battle-active .enemy-card-header {
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  body.theme-ashen.screen-battle-active .hero-card-header {
    display: grid !important;
    grid-template-rows: 20px 20px !important;
    align-content: start !important;
  }

  body.theme-ashen.screen-battle-active .hero-status-row,
  body.theme-ashen.screen-battle-active .hero-status-row[hidden] {
    display: flex !important;
    min-width: 0;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    overflow: hidden !important;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  body.theme-ashen.screen-battle-active .hero-status-row[hidden] {
    visibility: hidden !important;
    pointer-events: none;
  }

  body.theme-ashen.screen-battle-active .hero-combat-scene,
  body.theme-ashen.screen-battle-active .enemy-combat-scene {
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  body.theme-ashen.screen-battle-active .enemy-combat-scene {
    grid-template-rows: 28px minmax(0,1fr) !important;
  }

  body.theme-ashen.screen-battle-active .enemy-intent-slot {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    overflow: hidden !important;
  }

  body.theme-ashen.screen-battle-active .enemy-intent-slot .enemy-intent {
    display: -webkit-box !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    overflow: hidden !important;
    white-space: normal !important;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body.theme-ashen.screen-battle-active .enemy-role,
  body.theme-ashen.screen-battle-active .enemy-role[hidden],
  body.theme-ashen.screen-battle-active .enemy-role.armor-redundant {
    display: block !important;
    box-sizing: border-box;
    height: 29px !important;
    min-height: 29px !important;
    max-height: 29px !important;
    margin: 0 !important;
    overflow: hidden !important;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  body.theme-ashen.screen-battle-active .enemy-role[hidden],
  body.theme-ashen.screen-battle-active .enemy-role.armor-redundant {
    visibility: hidden !important;
    pointer-events: none;
  }

  body.theme-ashen.screen-battle-active .combat-state-stack,
  body.theme-ashen.screen-battle-active .enemy-state-stack {
    box-sizing: border-box;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
    align-content: start;
  }

  body.theme-ashen.screen-battle-active .enemy-armor-wrap,
  body.theme-ashen.screen-battle-active .enemy-armor-wrap[hidden] {
    display: grid !important;
    box-sizing: border-box;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    margin: 1px 0 0 !important;
  }

  body.theme-ashen.screen-battle-active .enemy-armor-wrap[hidden] {
    visibility: hidden !important;
    pointer-events: none;
  }

  body.theme-ashen.screen-battle-active #combatMechanicsStatus {
    box-sizing: border-box;
    max-height: 40px !important;
    overflow: hidden !important;
    contain: layout paint;
  }

  body.theme-ashen.screen-battle-active #combatMechanicsStatus .combat-guidance-slot,
  body.theme-ashen.screen-battle-active #combatEffectState,
  body.theme-ashen.screen-battle-active #combatPreviewState {
    max-height: 34px !important;
    overflow: hidden !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 370px), (max-height: 760px) and (max-width: 767px) {
  body.theme-ashen.screen-battle-active .battle-stage .combatant {
    height: 252px !important;
    min-height: 252px !important;
    max-height: 252px !important;
  }

  body.theme-ashen.screen-battle-active .battle-stage .combatant-hero {
    grid-template-rows: 39px minmax(0,1fr) 44px !important;
  }

  body.theme-ashen.screen-battle-active .battle-stage .combatant-enemy {
    grid-template-rows: 52px minmax(0,1fr) 25px 61px !important;
  }

  body.theme-ashen.screen-battle-active .hero-card-header {
    grid-template-rows: 18px 18px !important;
  }

  body.theme-ashen.screen-battle-active .hero-status-row,
  body.theme-ashen.screen-battle-active .hero-status-row[hidden] {
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
  }

  body.theme-ashen.screen-battle-active .enemy-combat-scene {
    grid-template-rows: 24px minmax(0,1fr) !important;
  }

  body.theme-ashen.screen-battle-active .enemy-intent-slot {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
  }

  body.theme-ashen.screen-battle-active .enemy-intent-slot .enemy-intent {
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    font-size: 7.5px !important;
  }

  body.theme-ashen.screen-battle-active .enemy-role,
  body.theme-ashen.screen-battle-active .enemy-role[hidden],
  body.theme-ashen.screen-battle-active .enemy-role.armor-redundant {
    height: 25px !important;
    min-height: 25px !important;
    max-height: 25px !important;
  }
}

/* Commission board: same visual density as the Patrol service. */
body.theme-ashen.screen-map-active .commission-service {
  padding-bottom: calc(10px + env(safe-area-inset-bottom,0px));
}

body.theme-ashen.screen-map-active .commission-refresh-panel {
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
}

body.theme-ashen.screen-map-active .commission-refresh-panel button {
  min-width: 82px;
  min-height: 38px;
  padding: 7px 10px;
  font-size: 11px;
}

body.theme-ashen.screen-map-active .commission-board {
  gap: 8px;
}

body.theme-ashen.screen-map-active .commission-card {
  padding: 10px;
  border-left-width: 3px;
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.025);
}

body.theme-ashen.screen-map-active .commission-card header {
  grid-template-columns: 30px minmax(0,1fr) auto;
  gap: 8px;
}

body.theme-ashen.screen-map-active .commission-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

body.theme-ashen.screen-map-active .commission-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.7;
}

body.theme-ashen.screen-map-active .commission-card header h4 {
  margin-top: 1px;
  font-size: 13px;
  line-height: 1.15;
}

body.theme-ashen.screen-map-active .commission-rarity,
body.theme-ashen.screen-map-active .commission-stamp {
  font-size: 8px;
}

body.theme-ashen.screen-map-active .commission-card > p {
  margin: 7px 0;
  font-size: 11px;
  line-height: 1.32;
}

body.theme-ashen.screen-map-active .commission-objective {
  gap: 4px 8px;
  padding: 7px 0;
}

body.theme-ashen.screen-map-active .commission-objective > span,
body.theme-ashen.screen-map-active .commission-reward > span {
  font-size: 9px;
}

body.theme-ashen.screen-map-active .commission-objective > strong,
body.theme-ashen.screen-map-active .commission-reward strong {
  font-size: 11px;
}

body.theme-ashen.screen-map-active .commission-progress {
  height: 4px;
}

body.theme-ashen.screen-map-active .commission-reward {
  padding: 7px 8px;
  border-radius: 9px;
}

body.theme-ashen.screen-map-active .commission-card footer {
  gap: 6px;
  margin-top: 8px;
}

body.theme-ashen.screen-map-active .commission-card footer button {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 11px;
}

body.theme-ashen.screen-map-active .commission-card footer .commission-primary {
  min-width: 98px;
}

body.theme-ashen.screen-map-active .path-service-view {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

body.theme-ashen.screen-map-active .path-outpost-view {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

body.theme-ashen.screen-map-active .path-service-grid {
  align-content: start;
}

body.theme-ashen.screen-map-active .path-service-card {
  grid-template-columns: 28px minmax(0,1fr);
  column-gap: 7px;
  min-height: 68px;
  padding: 8px;
  border-radius: 12px;
}

body.theme-ashen.screen-map-active .path-service-card > span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 16px;
}

body.theme-ashen.screen-map-active .path-service-card strong {
  font-size: 11px;
}

body.theme-ashen.screen-map-active .path-service-card small {
  font-size: 8.5px;
  line-height: 1.2;
}

@media (max-width: 390px) {
  body.theme-ashen.screen-map-active .commission-card {
    padding: 9px;
  }

  body.theme-ashen.screen-map-active .commission-card header {
    grid-template-columns: 28px minmax(0,1fr) auto;
    gap: 7px;
  }

  body.theme-ashen.screen-map-active .commission-icon {
    width: 26px;
    height: 26px;
  }

  body.theme-ashen.screen-map-active .commission-icon svg {
    width: 15px;
    height: 15px;
  }

  body.theme-ashen.screen-map-active .commission-stamp {
    grid-column: auto;
    justify-self: end;
    margin-top: 0;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.theme-ashen.screen-map-active .commission-card > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}
