:root {
  --positive56: #7fcca4;
  --special56: #bc9ce6;
  --warning56: #e4ae65;
  --negative56: #ec8285;
}
/* An implicit auto grid track otherwise expands to a long nowrap channel name. */
.home-first57 {
  grid-template-columns: minmax(0, 1fr);
}
.home-first57 > * {
  min-width: 0;
  max-width: 100%;
}
.home-first57 .hero-number55 strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.stable-recovery,
.stable-unlocks {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.stable-recovery {
  border-color: var(--warning56);
}
.stable-recovery h3 {
  font-size: 16px;
  margin: 0 0 10px;
}
.stable-recovery p,
.stable-unlocks p,
.stable-budget-warning,
.stable-cost-summary {
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.stable-recovery small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.stable-unlocks summary {
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.stable-budget-warning {
  border-left: 3px solid var(--warning56);
  padding: 10px 12px;
  color: var(--warning56);
  background: #e4ae6510;
}
.stable-cost-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.v56-result-feedback {
  overflow-wrap: anywhere;
}
.v56-result-feedback summary {
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
}
.large-type .stable-recovery p,
.large-type .stable-budget-warning,
.large-type .stable-cost-summary {
  font-size: 15px;
}
.game-modal input {
  max-width: 100%;
  min-width: 0;
}
.profile-colors button {
  touch-action: manipulation;
}
@media (max-width: 359px) {
  .v56-effect-grid {
    grid-template-columns: 1fr !important;
  }
  .stable-recovery {
    padding: 12px;
  }
}
.v56-user-icon {
  width: 60%;
  height: 60%;
  max-width: 56px;
  max-height: 56px;
  flex-shrink: 0;
}
.monogram[data-accent="red"] {
  color: #eb9090;
}
.monogram[data-accent="gray"] {
  color: #bcbfc5;
}
.profile-colors {
  align-items: center;
  flex-wrap: wrap;
}
.profile-colors button {
  box-sizing: border-box !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  flex: 0 0 48px !important;
  aspect-ratio: 1/1 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-colors button.chosen {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}
.v56-channel-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.v56-effect {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid currentColor;
  border-radius: 6px;
  line-height: 1.45;
}
.v56-effect i {
  font-style: normal;
}
.positive {
  color: var(--positive56) !important;
}
.negative {
  color: var(--negative56) !important;
}
.special {
  color: var(--special56) !important;
}
.warning,
.v56-warning {
  color: var(--warning56) !important;
}
.neutral {
  color: var(--soft) !important;
}
.settings-modal .setting-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  min-height: 72px;
}
.setting-row > div {
  min-width: 0;
  flex: 1;
}
.setting-row label {
  display: block;
  line-height: 1.4;
}
.setting-row p {
  margin: 5px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.v56-setting-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px !important;
  height: 48px !important;
  min-width: 58px;
  min-height: 48px;
  padding: 0 !important;
  flex: 0 0 58px;
  border: none;
  background: transparent !important;
  border-radius: 8px;
}
.v56-switch-track {
  position: relative;
  width: 50px;
  height: 28px;
  background: #4a4a51;
  border: 1px solid #6a6a72;
  border-radius: 999px;
  transition: background 120ms;
}
.v56-switch-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #f4f4f1;
  border-radius: 50%;
  transform: translateX(0);
  transition: transform 120ms;
}
.v56-setting-switch[aria-checked="true"] .v56-switch-track {
  background: #c63338;
  border-color: #e35c61;
}
.v56-setting-switch[aria-checked="true"] .v56-switch-thumb {
  transform: translateX(22px);
}
.v56-setting-switch:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.v56-setting-switch:disabled {
  opacity: 0.45;
}
.game-modal {
  box-sizing: border-box !important;
  max-height: calc(
    100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px
  ) !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.settings-theme button {
  min-width: 0;
  white-space: normal;
}
.v56-quota {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.v56-quota > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.v56-quota strong {
  font-size: 14px;
}
.v56-quota span,
.v56-quota summary,
.v56-quota p {
  font-size: 12px;
  color: var(--soft);
  line-height: 1.65;
}
.v56-quota details {
  margin-top: 8px;
}
.v56-quota summary {
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
}
.v56-strategy {
  margin: 4px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.v56-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.v56-section-heading h3 {
  font-size: 16px;
}
.v56-section-heading > span {
  font-size: 11px;
  color: var(--soft);
}
.v56-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.v56-plan {
  min-height: 98px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.v56-plan.selected {
  border-color: #bd777c;
  background: #342327;
  box-shadow: inset 0 0 0 1px #bd777c;
}
.v56-plan strong {
  font-size: 13px;
}
.v56-plan small,
.v56-plan span {
  font-size: 11px;
  line-height: 1.5;
  color: var(--soft);
}
.v56-forecast {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.v56-effect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}
.v56-forecast p {
  font-size: 12px;
  line-height: 1.65;
  margin: 12px 0;
}
.v56-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.v56-signals span {
  font-size: 11px;
  padding: 5px 7px;
  background: var(--surface2);
  border-radius: 6px;
}
.v56-forecast > small {
  display: block;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.65;
  margin-top: 12px;
}
.v56-result-feedback {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 16px 0;
}
.v56-result-feedback h3 {
  font-size: 15px;
  margin-bottom: 10px;
}
.v56-result-feedback p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--soft);
}
.v56-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tier-color);
  border: 1px solid var(--tier-color);
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--surface2);
  font-weight: 650;
  font-size: 20px;
}
.v56-tier-badge b {
  font-size: 24px;
}
.v56-tier-badge.small {
  font-size: 11px;
  padding: 5px 9px;
  gap: 6px;
  border-radius: 7px;
}
.v56-tier-badge.small b {
  font-size: 12px;
}
.v56-tier-badge.tier-world {
  border-style: double;
  border-width: 3px;
}
.v56-title {
  display: inline-flex;
  border-left: 2px solid var(--tier-color, #c0c0c8);
  color: var(--tier-color, #c0c0c8);
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.5;
  background: var(--surface2);
  border-radius: 4px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.v56-channel-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.v56-world header h1 {
  font-size: 28px;
  line-height: 1.35;
  margin: 10px 0;
}
.v56-world p,
.v56-public-channel p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--soft);
}
.v56-online-status {
  border: 1px solid #716346;
  background: #302a20;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  color: #e3c28f;
}
.v56-online-status p,
.v56-online-status small {
  color: #cfb58c;
}
.v56-world-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0;
}
.v56-world-tabs button {
  min-height: 48px;
  padding: 9px 12px;
  background: var(--surface2);
  color: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}
.v56-world-tabs button.chosen {
  color: var(--text);
  border-color: #a87176;
  background: #332529;
}
.v56-world section:not(.v56-trophies) {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
}
.v56-tier-card > h2 {
  font-size: 22px;
  margin: 18px 0 10px;
}
.v56-tier-card progress {
  width: 100%;
  height: 6px;
  accent-color: #c7b480;
}
.v56-tier-road {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.v56-tier-road > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.v56-tier-road small {
  font-size: 10px;
  color: var(--soft);
}
.v56-trophies {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 20px;
}
.v56-trophies h3 {
  font-size: 17px;
}
.v56-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.v56-title-list {
  list-style: none;
  padding: 0;
}
.v56-title-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.v56-title-list strong {
  display: block;
  font-size: 13px;
}
.v56-title-list small {
  display: block;
  color: var(--soft);
  font-size: 11px;
  margin-top: 5px;
}
.v56-title-list button {
  font-size: 11px;
  min-height: 44px;
  padding: 8px 10px;
  flex-shrink: 0;
}
.v56-filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.v56-filter-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.v56-filter-row select {
  min-height: 44px;
  max-width: 100%;
  background: var(--surface2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 7px;
  padding: 8px;
}
.v56-empty {
  padding: 24px 14px;
  margin: 16px 0;
  background: var(--surface2);
  border-radius: 12px;
}
.v56-world details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
}
.v56-world input {
  margin: 12px 0;
  max-width: 100%;
}
.v56-world h2 {
  font-size: 20px;
}
.v56-public-channel small {
  color: var(--soft);
  overflow-wrap: anywhere;
}
.v56-public-channel ul {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.v56-public-channel li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.v56-public-channel li span {
  display: block;
  font-size: 12px;
  color: var(--soft);
  margin-top: 6px;
}
.v56-promotion {
  width: calc(100% - 36px);
  max-width: 420px;
  background: var(--surface, #17171a);
  color: var(--text, #f4f4ef);
  border: 1px solid #887752;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  max-height: calc(100dvh - 36px);
  overflow: auto;
  box-sizing: border-box;
}
.v56-promotion::backdrop {
  background: #000b;
}
.v56-promotion .v56-tier-badge {
  margin: 22px 0;
}
.v56-promotion h2 {
  font-size: 22px;
}
.v56-promotion p {
  font-size: 13px;
  color: var(--soft);
  line-height: 1.7;
  margin: 16px 0;
}
.v56-promotion[open] {
  animation: v56-promote 260ms ease-out;
}
@keyframes v56-promote {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 1000px) {
  .navigation .nav-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
  .polish55 .nav-item {
    padding: 6px 2px !important;
  }
  .polish55 .nav-item > span {
    font-size: 11px !important;
  }
  .v56-tier-road {
    grid-template-columns: repeat(2, 1fr);
  }
  .v56-world header h1 {
    font-size: 25px;
  }
}
@media (max-width: 359px) {
  .v56-plan-grid {
    grid-template-columns: 1fr;
  }
  .v56-world section:not(.v56-trophies) {
    padding: 15px;
  }
  .v56-title-list li {
    align-items: flex-start;
    flex-direction: column;
  }
  .v56-world-tabs button {
    flex: 1 1 40%;
  }
  .setting-row p {
    font-size: 12px !important;
  }
  .v56-quota {
    padding: 12px;
  }
}
.large-type .v56-quota span,
.large-type .v56-world p,
.large-type .v56-plan span,
.large-type .v56-forecast p {
  font-size: 14px;
}
.large-type .v56-plan strong {
  font-size: 15px;
}
.v56-rank-positions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.v56-rank-position {
  border: 1px solid #6d6250;
  border-radius: 10px;
  padding: 14px 9px;
  background: var(--surface2);
  text-align: center;
  min-width: 0;
}
.v56-rank-position > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
}
.v56-rank-position b,
.v56-rank-position small,
.v56-rank-position span {
  display: block;
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.v56-rank-position small {
  color: var(--soft);
}
.rank-1 {
  border-color: #bd9d55;
  color: #dfc17d;
}
.rank-2 {
  border-color: #8e9aa9;
  color: #bcc5d1;
}
.rank-3 {
  border-color: #a87551;
  color: #cb9c7d;
}
.v56-title.rank-1:before {
  content: "Ⅰ";
  margin-right: 6px;
  color: #dfc17d;
}
.v56-title.rank-2:before {
  content: "Ⅱ";
  margin-right: 6px;
  color: #bcc5d1;
}
.v56-title.rank-3:before {
  content: "Ⅲ";
  margin-right: 6px;
  color: #cb9c7d;
}

/* V5.7 contextual decisions, existing dark theme retained */
.v57-context,
.v57-summary {
  padding: 12px;
  border: 1px solid #353539;
  border-radius: 14px;
  margin: 10px 0;
  background: #171719;
  min-width: 0;
}
.v57-context p,
.v57-summary p,
.v57-result p {
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.v57-context summary,
.v57-summary summary,
.v57-result summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.v57-strategy .v56-plan {
  min-height: 132px;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.v57-strategy .v56-plan small {
  line-height: 1.5;
}
.v57-strategy .v56-plan-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.v57-result details {
  border-top: 1px solid #38383c;
  margin-top: 10px;
}
.v57-strategy h3 {
  font-size: 17px;
  line-height: 1.5;
}
@media (max-width: 350px) {
  .v57-strategy .v56-plan-grid {
    gap: 8px;
  }
  .v57-strategy .v56-plan {
    padding: 10px;
    font-size: 13px;
  }
}
