#preparation-actions #prep-claim-advanced { min-height: 44px; border-color: #bba16b; background: #4e4930; color: #fff0ce; }
#prep-claim-advanced:focus-visible { outline: 2px solid #ffe2a1; outline-offset: 3px; }
#permanent-challenge-control { position: relative; flex: 0 0 210px; width: 210px; min-width: 0; color: #eee4cd; pointer-events: auto; }
#permanent-challenge-control[hidden], #permanent-challenge-control [hidden] { display: none !important; }
#permanent-challenge-panel { position: absolute; right: 0; bottom: calc(100% + 6px); display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; width: min(336px, calc(100vw - 24px)); padding: 8px; box-sizing: border-box; border: 1px solid #65705d; border-radius: 6px; background: #111b21f5; }
.permanent-challenge-heading { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.permanent-challenge-heading strong { color: #f2d99d; font-size: 12px; }
#permanent-challenge-count { color: #eee4cd; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.permanent-challenge-actions { display: flex; gap: 4px; }
#permanent-challenge-control button { min-width: 44px; min-height: 44px; padding: 5px 9px; border: 1px solid #8d977e; border-radius: 6px; background: #30433e; color: #f3e8ca; font: inherit; cursor: pointer; touch-action: manipulation; }
#permanent-challenge-control button:disabled { opacity: .5; cursor: default; }
#permanent-challenge-control button:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 2px; }
#permanent-challenge-toggle { width: 100%; text-align: left; }
#permanent-challenge-note { flex-basis: 100%; margin: 0; color: #c5d8c9; font-size: 11px; line-height: 1.4; text-align: left; }
#permanent-challenge-error { flex-basis: 100%; margin: 0; color: #ffceb0; font-size: 11px; }
#permanent-challenge-control .permanent-challenge-exchange { margin-left: auto; font-size: 11px; }
#preparation-actions:has(#permanent-challenge-control) { flex-wrap: wrap; }
@media (orientation: landscape) {
  body.mobile-layout #permanent-challenge-control { position: fixed; right: calc(var(--mobile-edge-right) + 12px); bottom: calc(var(--mobile-edge-bottom) + 132px); width: 210px; }
  body.mobile-layout #permanent-challenge-panel { max-height: calc(100dvh - var(--mobile-edge-top) - var(--mobile-edge-bottom) - 190px); overflow-y: auto; }
  body.mobile-layout #preparation-actions:has(#prep-next-boss[hidden]) #permanent-challenge-control { bottom: calc(var(--mobile-edge-bottom) + 78px); }
  body.mobile-layout #preparation-actions:has(#prep-next-boss[hidden]) #permanent-challenge-panel { max-height: calc(100dvh - var(--mobile-edge-top) - var(--mobile-edge-bottom) - 136px); }
}
#progression-overlay[hidden], #progression-overlay [hidden] { display: none !important; }
#progression-overlay { position: fixed; inset: 0; z-index: 340; display: grid; place-items: center; padding: max(8px, var(--rd-safe-area-top)) max(10px, var(--rd-safe-area-right)) max(8px, var(--rd-safe-area-bottom)) max(10px, var(--rd-safe-area-left)); background: #050b10dc; box-sizing: border-box; color: #eee4cd; font: 12px/1.5 'Microsoft YaHei', system-ui, sans-serif; }
/* The launcher hides all other body children with three ID exclusions. */
body.entry-shell > #progression-overlay:not(#game-entry-overlay):not(#hero-selection-modal):not(#game-session-frame):not([hidden]) { display: grid !important; z-index: 650; }
#progression-dialog { display: flex; flex-direction: column; width: min(960px, 100%); max-height: 100%; min-height: 0; overflow: hidden; padding: 12px; box-sizing: border-box; border: 2px solid #ae935f; border-radius: 10px; background: linear-gradient(140deg, #233034, #111b21); box-shadow: 0 12px 40px #000b; }
#progression-dialog button, #progression-dialog input, #progression-dialog select, #progression-dialog textarea { font: inherit; }
#progression-dialog button { min-height: 44px; padding: 6px 10px; border: 1px solid #8d977e; border-radius: 6px; background: #30433e; color: #f3e8ca; cursor: pointer; touch-action: manipulation; }
#progression-dialog button:disabled { opacity: .5; cursor: default; }
#progression-dialog button:focus-visible, #progression-dialog input:focus-visible, #progression-dialog select:focus-visible, #progression-dialog textarea:focus-visible { outline: 2px solid #ffe2a0; outline-offset: 2px; }
.progression-header, .progression-tabs, .progression-footer, #progression-storage-warning, #progression-advanced { flex: 0 0 auto; }
.progression-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#progression-title { flex: 0 0 auto; margin: 0; font-size: 17px; color: #ffdfa0; white-space: nowrap; }
#progression-close { flex: 0 0 auto; }
.progression-account { display: flex; flex: 1; min-width: 0; align-items: center; flex-wrap: nowrap; gap: 6px; }
.progression-account > strong { margin-right: auto; font-size: 14px; white-space: nowrap; }
#progression-points { color: #ffe0a1; font-size: 19px; font-variant-numeric: tabular-nums; }
.progression-account label { display: flex; align-items: center; gap: 6px; }
#progression-code { width: 120px; min-width: 0; padding: 5px 0; border: 0; background: transparent; color: #cfdfdf; font-variant-numeric: tabular-nums; }
#progression-remote-status { flex: 0 1 180px; min-width: 0; margin: 0; min-height: 16px; color: #aebfbc; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
#progression-storage-warning { margin: 4px 0; padding: 5px 8px; border: 1px solid #b77f61; border-radius: 5px; color: #ffceb0; background: #522b22; }
#progression-advanced { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 6px; margin: 4px 0; border: 1px solid #c4a45e; border-radius: 6px; background: #4a4025; }
#progression-claim-advanced { background: #705a28 !important; }
.progression-tabs { display: flex; gap: 6px; padding: 3px 0 5px; border-bottom: 1px solid #65705d; }
.progression-tabs > button { flex: 1; min-width: 0; }
.progression-tabs [aria-selected='true'] { border-color: #dbbb74 !important; background: #62522d !important; color: #fff0ca !important; }
.progression-panels { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 9px 2px 2px; }
#progression-free { padding: 6px 8px; border: 1px solid #617765; border-radius: 5px; background: #21372f; color: #d4e7bd; }
.progression-note { margin: 6px 0 9px; color: #b5c4bf; font-size: 11px; line-height: 1.6; }
#progression-shop-grid, #progression-parts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.progression-card { display: flex; flex-direction: column; min-width: 0; padding: 10px; border: 1px solid #576b66; border-radius: 6px; background: #1b2b30; }
.progression-card h3 { margin: 0 0 4px; font-size: 13px; color: #f2d99d; }
.progression-description { margin: 0 0 5px; color: #b3c3bf; font-size: 11px; line-height: 1.5; }
.progression-effect { margin: 4px 0; color: #dce6cd; font-size: 11px; }
.progression-next { flex: 1; margin: 4px 0 8px; color: #b9d1dc; font-size: 11px; }
.progression-card > button { width: 100%; margin-top: auto; }
.progression-parts-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.progression-parts-top label { display: flex; align-items: center; gap: 8px; }
.progression-parts-top select, #progression-feedback-kind { min-height: 44px; padding: 5px 8px; border: 1px solid #7b8c7e; border-radius: 5px; background: #112229; color: #eee4cd; }
#progression-parts-summary { color: #d6d5b8; font-size: 11px; }
.progression-record-columns { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; }
.progression-record-columns h3 { margin: 0 0 6px; color: #f2d99d; font-size: 14px; }
.progression-backup-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#progression-nickname-form { margin-bottom: 14px; }
.progression-nickname-controls { display: flex; align-items: center; gap: 6px; }
#progression-nickname { min-width: 0; width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid #718276; border-radius: 5px; background: #0e1c22; color: #eee4cd; box-sizing: border-box; }
#progression-nickname-save { flex: 0 0 auto; }
#progression-record-summary { color: #c2d6c7; font-size: 11px; }
#progression-history { padding-left: 18px; margin: 7px 0; color: #b9c9c3; font-size: 11px; }
.progression-leaderboard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#progression-leaderboard-self { color: #ffe0a1; font-size: 13px; }
#progression-leaderboard-status { margin: 5px 0; color: #b5c4bf; font-size: 11px; }
#progression-leaderboard-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#progression-leaderboard-table th:first-child { width: 44px; }
#progression-leaderboard-table th:last-child { width: 78px; }
.progression-leaderboard-player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.progression-leaderboard-player > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progression-leaderboard-player > small { flex: 0 0 auto; color: #b5c4bf; font-size: 10px; }
#progression-leaderboard-table th, #progression-leaderboard-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #40534f; }
#progression-leaderboard-table th { color: #c8d1bc; background: #263833; }
#progression-leaderboard-table th:last-child, #progression-leaderboard-table td:last-child { text-align: right; }
.progression-leaderboard-own { background: #57492b; color: #fff0ca; }
#progression-feedback-form { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; }
#progression-feedback-form label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#progression-feedback-content { resize: vertical; min-height: 82px; padding: 8px; border: 1px solid #718276; border-radius: 5px; background: #0e1c22; color: #eee4cd; box-sizing: border-box; }
#progression-feedback-send { align-self: flex-end; min-width: 120px; }
.progression-balance { margin-left: auto; color: #bfcfc6; font-size: 12px; white-space: nowrap; }
.progression-profile-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.progression-profile-columns h3, #progression-panel-data h3 { margin: 0 0 8px; font-size: 14px; color: #efdbad; }
#progression-panel-data h3:not(:first-child) { margin-top: 24px; }
#progression-panel-records .progression-account { flex-wrap: wrap; margin-bottom: 18px; }
#progression-dialog[data-section='data'] .progression-tabs, #progression-dialog[data-section='feedback'] .progression-tabs { display: none; }
#progression-advanced[hidden] { display: none !important; }
#progression-advanced { flex-wrap: wrap; color: #f7e5ae; font: 12px/1.4 'Microsoft YaHei', sans-serif; }
#progression-advanced button { min-height: 44px; padding: 6px 12px; border: 1px solid #d5bd7d; border-radius: 6px; color: #fff3cb; cursor: pointer; touch-action: manipulation; }
#progression-reward-result { flex-basis: 100%; margin: 0; }
.run-entry-tools { display: flex; gap: 6px; flex: 0 0 auto; margin-top: 8px; }
.run-entry-tools > button { flex: 1; min-width: 0; }
#run-benefits-summary { flex: 0 0 auto; margin: 6px 0 0; color: #c5d8b8; font-size: 11px; }
.entry-shell .hero-selection-dialog { max-height: 100%; }
@media (orientation: landscape) and (max-height: 500px) {
  .entry-shell .hero-selection-dialog { padding: 8px 12px; }
  .entry-shell .hero-selection-dialog h2 { font-size: 16px; }
  .entry-shell .hero-selection-note { margin: 2px 0 5px; font-size: 11px; }
  .entry-shell .run-selection-body { gap: 10px; }
  .entry-shell .run-section-title { margin-bottom: 4px; font-size: 12px; }
  .entry-shell .hero-selection-choices { gap: 5px; }
  .entry-shell .hero-selection-choices button { padding: 5px 6px; gap: 1px 5px; }
  .entry-shell .hero-selection-choices small { min-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .entry-shell .run-difficulty-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .entry-shell .run-difficulty-choices button { flex-direction: column; justify-content: center; gap: 0; padding: 3px; }
  .entry-shell #run-difficulty-detail { margin: 4px 0 0; font-size: 10px; }
  .entry-shell .run-entry-tools { margin-top: 5px; }
  .entry-shell .run-entry-tools > button { min-height: 44px; padding: 4px 8px; font-size: 12px; }
  .entry-shell .run-selection-footer { margin-top: 5px; padding-top: 4px; }
  .progression-profile-columns { gap: 12px; }
}
.progression-footer { display: flex; align-items: baseline; gap: 8px; padding-top: 5px; margin-top: 5px; border-top: 1px solid #596958; }
#progression-result { flex: 1; min-width: 0; margin: 0; max-height: 34px; overflow-y: auto; color: #d4e8bc; font-size: 11px; white-space: pre-wrap; }
#progression-result.error { color: #ffbca6; }
body.mobile-layout .progression-desktop-button { display: none; }
body:not(.mobile-layout) > .progression-desktop-button { position: fixed; top: 64px; left: 12px; z-index: 111; }
@media (max-height: 400px) and (orientation: landscape) {
  #progression-dialog { padding: 8px 10px; }
  .progression-header { min-height: 44px; }
  .progression-account { gap: 4px 8px; }
  .progression-account > strong { font-size: 12px; }
  #progression-points { font-size: 16px; }
  #progression-code { width: 100px; font-size: 11px; }
  .progression-tabs { padding-top: 0; padding-bottom: 5px; }
  .progression-panels { padding-top: 6px; }
  .progression-card { padding: 8px; }
}
@media (max-width: 739px) and (orientation: landscape) {
  #progression-shop-grid, #progression-parts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progression-account { gap: 4px 6px; }
  .progression-account > strong { margin-right: 3px; }
  .progression-account button { padding: 5px 7px !important; font-size: 11px !important; }
  .progression-record-columns { gap: 10px; }
}
