/* V1.57 simultaneous action reveal: one calm readable beat before sequential settlement. */
html body:not(.maintenance-mode) .settlement-manifest {
  position: fixed;
  inset: 0;
  z-index: 246;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

html body:not(.maintenance-mode) .settlement-manifest::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 49%, rgba(7, 13, 22, 0.34) 0 24%, transparent 66%),
    linear-gradient(90deg, transparent 0 10%, rgba(2, 5, 9, 0.16) 50%, transparent 90%);
  opacity: 0;
  animation: settlement-manifest-vignette-in 420ms ease-out both;
}

html body:not(.maintenance-mode) .settlement-manifest-stage {
  position: relative;
  width: min(780px, calc(100vw - 40px));
  padding: clamp(13px, 1.7vw, 19px);
  border: 1px solid rgba(242, 204, 118, 0.46);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(250, 217, 146, 0.075), transparent 35%),
    linear-gradient(180deg, rgba(17, 24, 35, 0.96), rgba(5, 9, 15, 0.97));
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 0, 0, 0.42),
    0 0 28px rgba(224, 177, 82, 0.12),
    inset 0 1px 0 rgba(255, 244, 216, 0.13);
  overflow: hidden;
  animation: settlement-manifest-stage-in 500ms cubic-bezier(0.16, 0.86, 0.26, 1) both;
}

html body:not(.maintenance-mode) .settlement-manifest-stage::before,
html body:not(.maintenance-mode) .settlement-manifest-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent 8%, rgba(246, 210, 128, 0.68) 50%, transparent 92%);
  opacity: 0.8;
}

html body:not(.maintenance-mode) .settlement-manifest-stage::before { left: 8px; }
html body:not(.maintenance-mode) .settlement-manifest-stage::after { right: 8px; }

html body:not(.maintenance-mode) .settlement-manifest header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 32px;
  padding: 0 7px 12px;
  color: rgba(221, 230, 239, 0.72);
  line-height: 1;
  letter-spacing: 0.07em;
}

html body:not(.maintenance-mode) .settlement-manifest header::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 4px;
  left: 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239, 201, 111, 0.42) 18%, rgba(239, 201, 111, 0.72) 50%, rgba(239, 201, 111, 0.42) 82%, transparent);
}

html body:not(.maintenance-mode) .settlement-manifest header > span,
html body:not(.maintenance-mode) .settlement-manifest header > small {
  font-size: clamp(9px, 0.78vw, 11px);
  font-weight: 750;
  white-space: nowrap;
}

html body:not(.maintenance-mode) .settlement-manifest header > strong {
  color: #fff2c7;
  -webkit-text-fill-color: #fff2c7;
  font-size: clamp(15px, 1.55vw, 21px);
  font-weight: 950;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.76), 0 0 14px rgba(242, 198, 102, 0.22);
  white-space: nowrap;
}

html body:not(.maintenance-mode) .settlement-manifest header > small {
  justify-self: end;
  color: rgba(231, 221, 196, 0.62);
  -webkit-text-fill-color: rgba(231, 221, 196, 0.62);
  text-align: right;
}

html body:not(.maintenance-mode) .settlement-manifest-list {
  display: grid;
  grid-template-columns: repeat(var(--manifest-columns, 2), minmax(0, 1fr));
  gap: 9px;
}

html body:not(.maintenance-mode) .settlement-manifest[data-count="1"] .settlement-manifest-list {
  --manifest-columns: 1;
  max-width: 360px;
  margin-inline: auto;
}

html body:not(.maintenance-mode) .settlement-manifest[data-count="3"] .settlement-manifest-list,
html body:not(.maintenance-mode) .settlement-manifest[data-count="5"] .settlement-manifest-list,
html body:not(.maintenance-mode) .settlement-manifest[data-count="6"] .settlement-manifest-list,
html body:not(.maintenance-mode) .settlement-manifest[data-count="7"] .settlement-manifest-list,
html body:not(.maintenance-mode) .settlement-manifest[data-count="8"] .settlement-manifest-list,
html body:not(.maintenance-mode) .settlement-manifest[data-count="9"] .settlement-manifest-list,
html body:not(.maintenance-mode) .settlement-manifest[data-count="10"] .settlement-manifest-list {
  --manifest-columns: 3;
}

html body:not(.maintenance-mode) .settlement-manifest-item {
  --action-rgb: 196, 155, 101;
  --relation-rgb: 205, 177, 125;
  position: relative;
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 13px 10px 11px;
  border: 1px solid rgba(var(--action-rgb), 0.42);
  border-radius: 12px;
  background:
    linear-gradient(105deg, rgba(var(--action-rgb), 0.17), transparent 43%),
    linear-gradient(180deg, rgba(26, 33, 45, 0.96), rgba(8, 13, 21, 0.98));
  box-shadow:
    inset 3px 0 0 rgba(var(--relation-rgb), 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.24),
    0 0 14px rgba(var(--action-rgb), 0.08);
  overflow: hidden;
  opacity: 0;
  animation: settlement-manifest-item-in 390ms cubic-bezier(0.15, 0.84, 0.28, 1.08) both;
}

html body:not(.maintenance-mode) .settlement-manifest-item:nth-child(2) { animation-delay: 45ms; }
html body:not(.maintenance-mode) .settlement-manifest-item:nth-child(3) { animation-delay: 80ms; }
html body:not(.maintenance-mode) .settlement-manifest-item:nth-child(4) { animation-delay: 115ms; }
html body:not(.maintenance-mode) .settlement-manifest-item:nth-child(5) { animation-delay: 140ms; }
html body:not(.maintenance-mode) .settlement-manifest-item:nth-child(n + 6) { animation-delay: 165ms; }

html body:not(.maintenance-mode) .settlement-manifest-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, transparent 22%, rgba(255, 255, 255, 0.12) 43%, transparent 64%);
  transform: translateX(-118%);
  animation: settlement-manifest-sheen 480ms 80ms ease-out both;
}

html body:not(.maintenance-mode) .settlement-manifest-item[data-action="attack"] { --action-rgb: 236, 91, 78; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-action="defend"] { --action-rgb: 83, 171, 231; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-action="charge"] { --action-rgb: 238, 187, 69; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-action="ended"] { --action-rgb: 129, 139, 151; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-action="skill"] { --action-rgb: 188, 105, 230; }

html body:not(.maintenance-mode) .settlement-manifest-item[data-relation="self"] { --relation-rgb: 245, 208, 112; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-relation="ally"] { --relation-rgb: 84, 200, 205; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-relation="enemy"] { --relation-rgb: 232, 99, 86; }
html body:not(.maintenance-mode) .settlement-manifest-item[data-relation="unknown"] { --relation-rgb: 184, 126, 218; }

html body:not(.maintenance-mode) .settlement-manifest-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--action-rgb), 0.6);
  border-radius: 50%;
  color: rgb(var(--action-rgb));
  background:
    radial-gradient(circle at 34% 27%, rgba(255, 255, 255, 0.18), transparent 31%),
    rgba(var(--action-rgb), 0.12);
  box-shadow: 0 0 16px rgba(var(--action-rgb), 0.2), inset 0 0 0 3px rgba(0, 0, 0, 0.18);
}

html body:not(.maintenance-mode) .settlement-manifest-icon svg {
  width: 25px;
  height: 25px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(var(--action-rgb), 0.35));
}

html body:not(.maintenance-mode) .settlement-manifest-item > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 3px 8px;
}

html body:not(.maintenance-mode) .settlement-manifest-item small {
  grid-column: 1;
  color: rgba(var(--relation-rgb), 0.92);
  -webkit-text-fill-color: rgba(var(--relation-rgb), 0.92);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

html body:not(.maintenance-mode) .settlement-manifest-item strong {
  grid-column: 1;
  color: #fff8e8;
  -webkit-text-fill-color: #fff8e8;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72), 0 0 9px rgba(var(--action-rgb), 0.24);
  white-space: nowrap;
}

html body:not(.maintenance-mode) .settlement-manifest-item em {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 148px;
  overflow: hidden;
  color: rgba(221, 229, 236, 0.7);
  -webkit-text-fill-color: rgba(221, 229, 236, 0.7);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body:not(.maintenance-mode).settlement-manifest-active #settlementLockOverlay strong {
  opacity: 0 !important;
  animation: none !important;
}

html body:not(.maintenance-mode) .settlement-manifest.settlement-manifest-converged .settlement-manifest-stage {
  animation: settlement-manifest-stage-out 120ms ease-in both;
}

html body:not(.maintenance-mode) .settlement-manifest.settlement-manifest-converged .settlement-manifest-item {
  animation: settlement-manifest-item-out 105ms ease-in both;
}

@keyframes settlement-manifest-vignette-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes settlement-manifest-stage-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.975); filter: brightness(1.28); }
  58% { opacity: 1; transform: translateY(-1px) scale(1.006); filter: brightness(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
}

@keyframes settlement-manifest-item-in {
  0% { opacity: 0; transform: translateY(7px) scale(0.97); filter: brightness(1.35); }
  70% { opacity: 1; transform: translateY(-1px) scale(1.008); filter: brightness(1.08); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
}

@keyframes settlement-manifest-sheen {
  0% { transform: translateX(-118%); opacity: 0; }
  32% { opacity: 0.78; }
  100% { transform: translateX(118%); opacity: 0; }
}

@keyframes settlement-manifest-stage-out {
  from { opacity: 1; transform: scale(1); filter: brightness(1); }
  to { opacity: 0; transform: scale(1.015); filter: brightness(1.16); }
}

@keyframes settlement-manifest-item-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-3px); }
}

@media (max-width: 720px) {
  html body:not(.maintenance-mode) .settlement-manifest {
    padding: 10px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-stage {
    width: min(100%, 470px);
    padding: 10px;
    border-radius: 14px;
  }

  html body:not(.maintenance-mode) .settlement-manifest header {
    grid-template-columns: 1fr auto;
    gap: 7px;
    min-height: 26px;
    padding: 0 5px 9px;
  }

  html body:not(.maintenance-mode) .settlement-manifest header > span {
    font-size: 9px;
  }

  html body:not(.maintenance-mode) .settlement-manifest header > strong {
    justify-self: end;
    font-size: 15px;
  }

  html body:not(.maintenance-mode) .settlement-manifest header > small {
    display: none;
  }

  html body:not(.maintenance-mode) .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="3"] .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="5"] .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="6"] .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="7"] .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="8"] .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="9"] .settlement-manifest-list,
  html body:not(.maintenance-mode) .settlement-manifest[data-count="10"] .settlement-manifest-list {
    --manifest-columns: 2;
    gap: 7px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-item {
    min-height: 61px;
    grid-template-columns: 35px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px 7px 7px;
    border-radius: 10px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-icon {
    width: 33px;
    height: 33px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-icon svg {
    width: 20px;
    height: 20px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-item > span {
    display: block;
  }

  html body:not(.maintenance-mode) .settlement-manifest-item small {
    display: block;
    margin-bottom: 3px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  html body:not(.maintenance-mode) .settlement-manifest-item strong {
    display: block;
    font-size: clamp(13px, 4vw, 17px);
  }

  html body:not(.maintenance-mode) .settlement-manifest-item em {
    display: none;
  }
}

@media (max-width: 370px) {
  html body:not(.maintenance-mode) .settlement-manifest-stage {
    padding: 8px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-item {
    min-height: 56px;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-icon {
    width: 29px;
    height: 29px;
  }

  html body:not(.maintenance-mode) .settlement-manifest-icon svg {
    width: 17px;
    height: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body:not(.maintenance-mode) .settlement-manifest::before,
  html body:not(.maintenance-mode) .settlement-manifest-stage,
  html body:not(.maintenance-mode) .settlement-manifest-item,
  html body:not(.maintenance-mode) .settlement-manifest-item::after,
  html body:not(.maintenance-mode) .settlement-manifest.settlement-manifest-converged .settlement-manifest-stage,
  html body:not(.maintenance-mode) .settlement-manifest.settlement-manifest-converged .settlement-manifest-item {
    animation: none !important;
  }
}
