/* Scoped to the weekly anomaly hub and its purchase confirmation. */
.abyss-anomaly-screen { --anomaly-accent: #e0a1b3; gap: 12px; }
.abyss-anomaly-screen .panel { padding: 16px; min-width: 0; }
.abyss-anomaly-screen h2, .anomaly-dialog h2 { margin: 0 0 12px; font-size: var(--ga-font-section); }
.abyss-anomaly-screen h3 { margin: 0; font-size: var(--ga-font-body); }
.abyss-anomaly-screen p, .anomaly-dialog p { margin: 8px 0 12px; line-height: 1.7; font-size: var(--ga-font-body); overflow-wrap: anywhere; }
.abyss-anomaly-screen .anomaly-note, .anomaly-dialog .anomaly-note { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid #a9bdd02c; background: #101822; padding: 12px 4px; }
.anomaly-overview > div { display: grid; gap: 6px; padding: 0 8px; border-right: 1px solid #a9bdd021; }
.anomaly-overview > div:last-child { border: 0; }
.anomaly-overview span { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-overview strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.anomaly-overview small { font-size: var(--ga-font-note); font-weight: 400; }
.anomaly-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.abyss-anomaly-screen .anomaly-tabs button { padding: 8px 4px; min-width: 0; min-height: 44px; }
.anomaly-tabs button.selected { border-color: var(--anomaly-accent); box-shadow: inset 0 -2px var(--anomaly-accent); }
.abyss-anomaly-screen .anomaly-feature { position: relative; overflow: hidden; border-top: 2px solid var(--anomaly-accent); background: radial-gradient(ellipse at 100% 45%, #8870b01c, transparent 70%), linear-gradient(130deg, #1e2631, #111923); }
.anomaly-rule-heading .eyebrow { color: var(--anomaly-accent); font-size: var(--ga-font-caption); letter-spacing: .14em; }
.anomaly-rule-heading h2 { margin: 6px 0 12px; font-size: 1.35rem; }
.abyss-anomaly-screen .anomaly-hint { padding-left: 12px; border-left: 2px solid var(--anomaly-accent); color: #d5dce5; font-size: var(--ga-font-note); }
.anomaly-boss { display: grid; grid-template-columns: 144px minmax(0, 1fr); align-items: center; gap: 16px; margin: 4px 0 12px; border-block: 1px solid #b9c2d021; }
.anomaly-boss img { width: 144px; height: 144px; object-fit: contain; filter: drop-shadow(0 8px 10px #0006); }
.anomaly-boss > div { display: grid; gap: 6px; padding: 12px 0; }
.anomaly-boss strong { font-size: 1.6rem; color: var(--anomaly-accent); }
.anomaly-boss span { font-size: var(--ga-font-body); overflow-wrap: anywhere; }
.anomaly-boss small, .anomaly-boss .eyebrow { font-size: var(--ga-font-caption); color: var(--muted); }
.anomaly-feature progress { width: 100%; height: 6px; accent-color: var(--anomaly-accent); margin: 0 0 12px; }
.abyss-anomaly-screen .anomaly-challenge { width: 100%; min-height: 48px; }
.anomaly-guide summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: var(--ga-font-body); }
.anomaly-training-list { display: grid; gap: 12px; margin-bottom: 16px; }
.anomaly-training { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid #a9bdd02c; }
.anomaly-training-portrait { width: 64px; height: 84px; overflow: hidden; }
.anomaly-training-portrait img { width: 100%; height: 100%; object-fit: contain; }
.anomaly-training > button, .anomaly-training > .limited-abyss-companion-strategy { grid-column: 1 / -1; }
.anomaly-training small { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-exchange-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.anomaly-exchange-grid button { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.anomaly-ranking ol { list-style: none; padding: 0; margin: 12px 0 0; }
.anomaly-weekly-restrictions > summary, .anomaly-unavailable-companions > summary { min-height: 44px; padding: 8px 0; color: var(--text); font-size: var(--ga-font-body); cursor: pointer; overflow-wrap: anywhere; }
.anomaly-weekly-restrictions p { font-size: var(--ga-font-note); line-height: 1.7; overflow-wrap: anywhere; }
.anomaly-legacy-companion { grid-column: 1 / -1; }
.anomaly-unavailable-companions { margin-top: 12px; border-top: 1px solid var(--anomaly-line); }
.anomaly-ranking li { display: grid; grid-template-columns: 2rem clamp(48px, 14vw, 72px) minmax(0, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid #a9bdd02c; padding: 12px 4px; }
.anomaly-ranking .anomaly-ranking-portrait { display: grid; place-items: center; height: 88px; min-width: 0; border-radius: var(--ga-radius-panel); background: radial-gradient(ellipse at center, #e0a1b31a, transparent 72%); }
.anomaly-ranking-portrait img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.anomaly-ranking .anomaly-ranking-player { min-width: 0; }
.anomaly-ranking .anomaly-ranking-name { display: block; width: 100%; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--ga-font-body); font-weight: 700; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; text-decoration: underline; text-decoration-color: var(--anomaly-line); text-underline-offset: 4px; }
.anomaly-ranking .anomaly-ranking-name:hover { color: var(--anomaly-accent); }
.anomaly-ranking .anomaly-ranking-name:focus-visible { outline: 2px solid var(--anomaly-accent); outline-offset: 2px; }
.anomaly-ranking li > span { display: grid; gap: 4px; overflow-wrap: anywhere; }
.anomaly-ranking li small { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-ranking li.anomaly-note { display: block; line-height: 1.7; }
.anomaly-ranking .is-mine { background: #b9a0e515; border-left: 2px solid var(--anomaly-accent); }
.anomaly-product { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid #a9bdd02c; }
.anomaly-product small, .anomaly-product .eyebrow { font-size: var(--ga-font-note); color: var(--muted); }
.abyss-anomaly-screen .anomaly-expiry, .anomaly-dialog .anomaly-expiry { color: #e0c58e; font-size: var(--ga-font-body); }
.anomaly-dialog-backdrop { position: fixed; inset: 0; z-index: 160; background: #050a11dd; display: grid; place-items: center; padding: 12px; }
.anomaly-dialog { width: min(100%, 480px); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; border: 1px solid #a7b7cb66; border-top: 2px solid #b9a0e5; background: #17212c; border-radius: 4px; padding: 16px; box-shadow: 0 20px 60px #0008; overflow: hidden; }
.anomaly-dialog-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.anomaly-cost { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.anomaly-cost > div { padding: 12px; background: #ffffff06; border: 1px solid #a9bdd02c; }
.anomaly-cost dt { font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-cost dd { margin: 6px 0 0; font-size: 1.1rem; font-weight: 700; }
.anomaly-dialog-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 12px; flex-shrink: 0; }
.anomaly-dialog-actions button { white-space: normal; min-width: 0; }
.anomaly-hold-button { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.anomaly-hold-ring { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; color: inherit; pointer-events: none; font-size: var(--ga-font-caption); font-variant-numeric: tabular-nums; }
.anomaly-hold-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-width: 3; transform: rotate(-90deg); }
.anomaly-hold-track { stroke: currentColor; opacity: .3; }
.anomaly-hold-progress { stroke: #fff0b8; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--anomaly-hold-progress, 0)); }
.anomaly-hold-button.is-holding { box-shadow: inset 0 0 0 1px #ffe8a7, 0 0 12px #e8b55255; }
.anomaly-hold-button.is-holding .anomaly-hold-ring { color: #fff7d9; }
.anomaly-hold-button.is-holding .anomaly-hold-progress { filter: drop-shadow(0 0 2px #ffce65); }
.anomaly-hold-button::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: var(--anomaly-hold, 0%); background: #e2d5aa; pointer-events: none; }
.abyss-anomaly-screen .law-core-library-row { min-width: 0; }
.abyss-anomaly-screen .law-core-library-row-copy { overflow-wrap: anywhere; min-width: 0; }
.abyss-anomaly-screen .law-core-all .law-core-library-row-copy { grid-column: 2 / -1; }
.abyss-anomaly-screen .limited-abyss-skill-slots .slot > .muted:only-child { grid-column: 1 / -1; font-size: var(--ga-font-note); line-height: 1.7; }
.abyss-anomaly-screen .limited-abyss-equipment-member strong { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
@media (max-width: 600px) {
  .abyss-anomaly-screen .panel { padding: 12px; }
  .anomaly-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .anomaly-boss { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
  .anomaly-boss img { width: 112px; height: 128px; }
  .anomaly-dialog { padding: 12px; }
  .anomaly-dialog-actions { grid-template-columns: 1fr; }
  .anomaly-dialog-actions button:first-child { order: 2; }
  .abyss-anomaly-screen .limited-abyss-command-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .anomaly-hold-button::after { transition: none; } }

.abyss-anomaly-screen .anomaly-pearl-pool summary { cursor:pointer; min-height:44px; display:flex; align-items:center; font-size:var(--ga-font-section); }
.abyss-anomaly-screen .anomaly-pearl-pool article { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; padding:12px 0; border-top:1px solid var(--border); overflow-wrap:anywhere; }
.abyss-anomaly-screen .anomaly-pearl-pool article p { grid-column:1/-1; margin:0; font-size:var(--ga-font-note); color:var(--muted); }

/* Weekly hub: illustration stays behind the title, while rules and costs use opaque surfaces. */
.abyss-anomaly-screen { --anomaly-line: color-mix(in srgb, var(--anomaly-accent), var(--line) 60%); --anomaly-surface: color-mix(in srgb, var(--surface), #101923 45%); }
.abyss-anomaly-screen > .panel { border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); background: linear-gradient(130deg, var(--surface-2), var(--anomaly-surface)); box-shadow: inset 0 1px #ffffff08; }
.abyss-anomaly-screen > .panel::after { display: none; }
.abyss-anomaly-screen .section-heading { gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.abyss-anomaly-screen .section-heading h2 { margin: 0; }
.abyss-anomaly-screen .section-heading > span { color: var(--muted); font-size: var(--ga-font-note); }
.abyss-anomaly-screen h2, .abyss-anomaly-screen h3 { font-family: inherit; }
.abyss-anomaly-screen .anomaly-portal { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); background: #111925; }
.anomaly-portal-art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% 45%; }
.anomaly-portal::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #0b101dd9, #0b101d1a 90%), linear-gradient(0deg, #0c1421ee, transparent 75%); pointer-events: none; }
.anomaly-portal::after { content: ''; position: absolute; inset: 8px; border: 1px solid #d6be8a30; pointer-events: none; }
.anomaly-portal-copy { padding: 24px 24px 16px; min-height: 180px; max-width: 72%; }
.anomaly-season { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; font-size: var(--ga-font-note); color: #e5d2a4; letter-spacing: .08em; }
.anomaly-season b { padding: 2px 8px; border: 1px solid var(--anomaly-line); border-radius: 2px; color: #e3ede9; background: #111d23ba; font-size: var(--ga-font-caption); font-weight: 400; letter-spacing: normal; }
.anomaly-theme-lead { font-size: var(--ga-font-note); color: #d7cce2; }
.abyss-anomaly-screen .anomaly-portal h2 { margin: 4px 0 12px; color: #fff1d9; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 1.75rem; font-weight: 600; line-height: 1.35; letter-spacing: .08em; text-shadow: 0 2px 8px #020510; }
.anomaly-theme-tags, .anomaly-pearl-promises { display: flex; flex-wrap: wrap; gap: 8px; }
.anomaly-theme-tags > span { padding: 2px 8px; border: 1px solid var(--anomaly-line); background: #101321b3; font-size: var(--ga-font-note); color: #e6deed; }
.anomaly-portal-rule { position: relative; margin: 0 24px 16px; padding-top: 12px; border-top: 1px solid #cec0dc44; }
.abyss-anomaly-screen .anomaly-portal-rule p { margin: 0 0 8px; color: #edf0f5; }
.anomaly-portal-rule > span { color: #c8cbd4; font-size: var(--ga-font-note); }
.anomaly-portal-rule .anomaly-challenge { margin-top: 16px; }
.abyss-anomaly-screen[data-anomaly="IRON_ABYSS"] .anomaly-portal-art { filter: saturate(.55); }
.abyss-anomaly-screen[data-anomaly="CRITICAL_FESTIVAL"] .anomaly-portal-art { filter: hue-rotate(100deg) saturate(.7); }
.abyss-anomaly-screen[data-anomaly="CURSED_TREASURE"] .anomaly-portal-art { filter: hue-rotate(150deg) saturate(.55); }
.anomaly-week-strip { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; border-left: 2px solid var(--anomaly-accent); padding: 8px 12px; background: var(--anomaly-surface); color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-week-strip strong { color: var(--anomaly-accent); margin-left: 8px; font-size: var(--ga-font-body); }
.anomaly-overview { padding: 12px 4px; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); background: linear-gradient(110deg, var(--anomaly-surface), var(--surface)); }
.anomaly-overview strong { color: var(--text); font-size: 1.35rem; line-height: 1.3; }
.anomaly-overview > div:nth-child(2) strong { color: var(--gold-strong); }
.anomaly-tabs { gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--anomaly-line); }
.abyss-anomaly-screen .anomaly-tabs button { position: relative; font-size: var(--ga-font-note); color: var(--muted); background: var(--anomaly-surface); box-shadow: none; }
.abyss-anomaly-screen .anomaly-tabs button.selected { color: var(--text); background: linear-gradient(0deg, color-mix(in srgb, var(--anomaly-accent), transparent 86%), var(--anomaly-surface)); border-color: var(--anomaly-accent); box-shadow: inset 0 -2px var(--anomaly-accent); }
.abyss-anomaly-screen .anomaly-feature { border-top: 1px solid var(--anomaly-line); }
.abyss-anomaly-screen .anomaly-hint { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 12px; border: 0; border-bottom: 1px solid var(--anomaly-line); margin: 0 0 16px; padding: 0 0 12px; }
.anomaly-hint > strong { color: var(--anomaly-accent); font-size: var(--ga-font-note); }
.abyss-anomaly-screen .anomaly-hint p { margin: 0; color: var(--text); font-size: var(--ga-font-body); }
.anomaly-expedition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .75fr); gap: 24px; align-items: center; }
.anomaly-departure { min-width: 0; }
.anomaly-destination { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.anomaly-destination > span:first-child { display: grid; gap: 4px; color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-destination strong { color: var(--text); font-size: 1.75rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.anomaly-destination strong small { font-size: var(--ga-font-body); color: var(--anomaly-accent); }
.anomaly-cleared { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-feature progress { display: block; height: 8px; border: 0; border-radius: 0; margin: 12px 0 16px; background: var(--surface); }
.anomaly-feature progress::-webkit-progress-bar { background: var(--surface); }
.anomaly-feature progress::-webkit-progress-value { background: linear-gradient(90deg, color-mix(in srgb, var(--anomaly-accent), #263140 50%), var(--anomaly-accent)); }
.anomaly-feature progress::-moz-progress-bar { background: var(--anomaly-accent); }
.abyss-anomaly-screen .anomaly-challenge { display: flex; justify-content: center; align-items: center; gap: 16px; }
.anomaly-rewards { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; margin-top: 12px; color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-rewards strong { color: var(--text); margin-left: 4px; }
.abyss-anomaly-screen .anomaly-boost-active { margin: 8px 0 0; font-size: var(--ga-font-note); color: var(--gold-strong); }
.anomaly-boss { position: relative; grid-template-columns: 112px minmax(0, 1fr); margin: 0; padding: 8px; gap: 8px; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); background: radial-gradient(ellipse at 20% 70%, color-mix(in srgb, var(--anomaly-accent), transparent 88%), transparent 70%), #070f172e; }
.anomaly-boss img { width: 112px; height: 120px; }
.anomaly-boss strong { font-size: 1.5rem; line-height: 1.2; }
.anomaly-boss strong small { color: var(--anomaly-accent); }
.anomaly-boss .eyebrow { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-preparation-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.abyss-anomaly-screen .anomaly-preparation-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; text-align: left; align-items: center; gap: 8px; min-height: 64px; }
.anomaly-preparation-link > b { color: var(--anomaly-accent); font-size: var(--ga-font-note); font-weight: 400; }
.anomaly-preparation-link > span { display: grid; gap: 4px; min-width: 0; }
.anomaly-preparation-link strong { font-size: var(--ga-font-body); }
.anomaly-preparation-link small { color: var(--muted); font-size: var(--ga-font-note); font-weight: 400; }
.anomaly-preparation-link i { font-style: normal; color: var(--muted); }
.abyss-anomaly-screen .anomaly-free-notice { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 8px 0; text-align: left; color: var(--text); border-top: 1px solid var(--anomaly-line); }
.anomaly-free-notice strong { color: var(--gold-strong); }
.anomaly-guide summary { justify-content: space-between; gap: 12px; }
.anomaly-guide[open] summary > span { transform: rotate(45deg); }
.anomaly-guide-steps { display: grid; gap: 16px; padding-left: 24px; margin: 16px 0; }
.anomaly-guide-steps li { padding-left: 4px; }
.anomaly-guide-steps li::marker { color: var(--anomaly-accent); }
.anomaly-guide-steps strong { font-size: var(--ga-font-body); }
.abyss-anomaly-screen .anomaly-guide-steps p { font-size: var(--ga-font-note); color: var(--muted); margin: 4px 0 0; }
.anomaly-reset-note { padding: 12px; border-left: 2px solid var(--anomaly-accent); background: var(--surface); font-size: var(--ga-font-note); }
.abyss-anomaly-screen .anomaly-reset-note p { font-size: var(--ga-font-note); margin: 4px 0 8px; }
.anomaly-reset-note > span { color: var(--anomaly-accent); }
.anomaly-section-label { margin-bottom: 8px; font-size: var(--ga-font-note); color: var(--anomaly-accent); }
.anomaly-pearl-promises { margin: 0 0 12px; }
.anomaly-pearl-promises > span { border-left: 2px solid var(--anomaly-accent); padding: 0 8px; color: var(--text); font-size: var(--ga-font-note); }
.anomaly-pool-group { border-top: 1px solid var(--anomaly-line); }
.abyss-anomaly-screen .anomaly-pool-group > summary { display: flex; justify-content: space-between; gap: 8px; min-height: 48px; cursor: pointer; font-size: var(--ga-font-body); }
.anomaly-pool-group > summary::before { content: '＋'; color: var(--anomaly-accent); }
.anomaly-pool-group[open] > summary::before { content: '−'; }
.anomaly-pool-group > summary > span { flex: 1; }
.anomaly-pool-group > summary b { color: var(--anomaly-accent); font-size: var(--ga-font-body); }
.anomaly-pool-group > summary small { font-weight: 400; font-size: var(--ga-font-note); }
.anomaly-pool-group > div { max-height: 32rem; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; scrollbar-width: thin; }
.anomaly-pool-status { font-size: var(--ga-font-note); color: var(--anomaly-accent); }
.anomaly-pool-group[data-pool-group="excluded"] .anomaly-pool-status { color: var(--muted); }
.anomaly-training { padding: 12px; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); background: var(--surface); }
.anomaly-product { position: relative; padding: 16px; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); margin-top: 12px; background: var(--surface); }
.abyss-anomaly-screen .anomaly-product p { margin: 0; }
.anomaly-product > .eyebrow { color: var(--anomaly-accent); font-size: var(--ga-font-caption); letter-spacing: .1em; }
.abyss-anomaly-screen .anomaly-free-support { border-top: 2px solid var(--anomaly-accent); }
.anomaly-ranking li > b { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--anomaly-line); font-size: var(--ga-font-body); font-variant-numeric: tabular-nums; }
.anomaly-ranking li:nth-child(-n+3) > b { border-color: color-mix(in srgb, var(--gold-strong), transparent 50%); color: var(--gold-strong); background: color-mix(in srgb, var(--gold-strong), transparent 92%); }
.anomaly-ranking li.is-mine { background: color-mix(in srgb, var(--anomaly-accent), transparent 90%); }
@media (max-width: 760px) {
  .anomaly-expedition { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .anomaly-preparation-links { grid-template-columns: minmax(0, 1fr); }
  .abyss-anomaly-screen .anomaly-preparation-link { min-height: 60px; }
  .anomaly-boss { grid-template-columns: 96px minmax(0, 1fr); }
  .anomaly-boss img { width: 96px; height: 100px; }
}
@media (max-width: 600px) {
  .anomaly-portal-copy { padding: 16px 16px 12px; min-height: 168px; max-width: 85%; }
  .anomaly-portal-art { object-position: 70% center; }
  .anomaly-portal::before { background: linear-gradient(90deg, #0b101dc9, #0b101d0d), linear-gradient(0deg, #0c1421f5 5%, transparent 90%); }
  .anomaly-season { margin-bottom: 12px; }
  .anomaly-portal-rule { margin: 0 16px 16px; }
  .abyss-anomaly-screen .anomaly-portal h2 { font-size: 1.5rem; }
  .anomaly-overview > div { padding: 0 8px; }
  .anomaly-overview strong { font-size: 1.2rem; }
  .abyss-anomaly-screen .anomaly-hint { grid-template-columns: minmax(0, 1fr); }
  .abyss-anomaly-screen .anomaly-pearl-pool article { grid-template-columns: minmax(0, 1fr); }
  .anomaly-pool-status { grid-row: 1; }
}
/* 人物別魔導珠。保存枠は装備の有効枠を超えても保持する。 */
.abyss-anomaly-screen .anomaly-orb-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding: 0; list-style: none; }
.abyss-anomaly-screen .anomaly-orb-slots > li { min-width: 0; border: 1px solid #64533b; border-radius: .55rem; overflow: hidden; background: #171c27; }
.abyss-anomaly-screen .anomaly-orb-slots > .is-dormant { border-style: dashed; background: #232630; }
.abyss-anomaly-screen .anomaly-orb-slot { display: flex; flex-direction: column; justify-content: center; align-items: start; gap: .3rem; width: 100%; min-height: 5rem; border: 0; border-radius: 0; padding: .6rem; text-align: left; white-space: normal; }
.abyss-anomaly-screen .anomaly-orb-slot small { font-size: .75rem; color: #c4bbad; }
.abyss-anomaly-screen .anomaly-orb-slot strong { font-size: .875rem; overflow-wrap: anywhere; }
.abyss-anomaly-screen .anomaly-orb-order { display: grid; grid-template-columns: 1fr 1fr; }
.abyss-anomaly-screen .anomaly-orb-order button { min-width: 0; min-height: 44px; padding: .25rem; }
.abyss-anomaly-screen .anomaly-orb-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.abyss-anomaly-screen .anomaly-orb-actions button { flex: 1 1 10rem; min-height: 44px; }
@media (max-width: 420px) {
  .abyss-anomaly-screen .anomaly-orb-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Anomaly-only: all 21 personal slots are active, independent of equipment. */
.abyss-anomaly-screen .anomaly-orb-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.abyss-anomaly-screen .anomaly-orb-slots > li { border-color: var(--anomaly-line); border-radius: var(--ga-radius-panel); }
/* Fill the stretched row when an active badge or a wrapped name makes a neighboring slot taller. */
.abyss-anomaly-screen .anomaly-orb-slot { position: relative; align-items: center; gap: 4px; height: 100%; min-height: 72px; padding: 8px 4px; background: var(--surface); }
.abyss-anomaly-screen .anomaly-orb-slot.is-filled { background: linear-gradient(150deg, var(--surface-2), var(--anomaly-surface)); }
.abyss-anomaly-screen .anomaly-orb-slot { touch-action: pan-y; -webkit-touch-callout: none; user-select: none; }
.abyss-anomaly-screen .anomaly-orb-slot.is-lifted .magic-orb { opacity: .2; }
.abyss-anomaly-screen .anomaly-orb-slot.is-drop-target { box-shadow: inset 0 0 0 2px var(--anomaly-accent); }
.abyss-anomaly-screen .anomaly-orb-slot > small { position: absolute; top: 4px; left: 8px; color: var(--muted); font-size: var(--ga-font-caption); }
.abyss-anomaly-screen .anomaly-orb-slot strong { font-size: var(--ga-font-note); line-height: 1.4; text-align: center; }
.anomaly-orb-icon { display: grid; place-items: center; width: 32px; height: 32px; }
.anomaly-orb-icon > i { font-style: normal; color: var(--muted); }
.anomaly-orb-icon > .magic-orb, .abyss-anomaly-screen .law-core-option-mark > .magic-orb, .abyss-anomaly-screen .law-core-library-row > .magic-orb { width: 32px; height: 32px; min-width: 0; }
.anomaly-orb-icon .magic-orb > img, .anomaly-reward-icon .magic-orb > img { width: 100%; height: 100%; }
.abyss-anomaly-screen .anomaly-orb-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; }
.abyss-anomaly-screen .anomaly-orb-actions .primary-button { min-height: 48px; }
.anomaly-orb-picker-order { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.anomaly-party-selectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.anomaly-party-selectors label { display: grid; gap: 4px; min-width: 0; font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-party-selectors select { width: 100%; min-width: 0; }
.anomaly-member-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.anomaly-member-switch label { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-member-switch select { width: 100%; min-width: 0; }
.abyss-anomaly-screen .limited-abyss-companion { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 12px; }
.abyss-anomaly-screen .limited-abyss-companion-portrait { width: 48px; height: 64px; grid-row: auto; }
.abyss-anomaly-screen .limited-abyss-companion-copy { min-width: 0; }
.abyss-anomaly-screen .limited-abyss-companion-copy header { display: grid; gap: 4px; }
.abyss-anomaly-screen .limited-abyss-companion-copy header strong { font-size: var(--ga-font-body); }
.abyss-anomaly-screen .limited-abyss-companion-copy header > span { font-size: var(--ga-font-note); }
.abyss-anomaly-screen .limited-abyss-companion > button { grid-column: auto; min-height: 44px; padding: 8px; font-size: var(--ga-font-note); }
.anomaly-recruit-detail { grid-column: 1 / -1; border-top: 1px solid var(--anomaly-line); }
.anomaly-recruit-detail > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: var(--ga-font-note); color: var(--muted); }
.abyss-anomaly-screen .anomaly-recruit-detail p { font-size: var(--ga-font-note); }
/* 雇用候補だけをイラスト主体にする。人物画像の透過をそのまま見せる。 */
.abyss-anomaly-screen .limited-abyss-recruitment .limited-abyss-companion-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.abyss-anomaly-screen .anomaly-recruit-card { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; border-color: var(--anomaly-line); border-radius: var(--ga-radius-panel); background: transparent; overflow: hidden; }
.abyss-anomaly-screen .anomaly-recruit-card > .anomaly-recruit-select { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px; width: 100%; min-width: 0; padding: 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text); white-space: normal; text-align: center; }
.abyss-anomaly-screen .anomaly-recruit-select:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: -3px; }
.abyss-anomaly-screen .anomaly-recruit-select .limited-abyss-companion-portrait { grid-row: auto; width: 100%; height: 144px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.abyss-anomaly-screen .anomaly-recruit-select .actor-image { width: 100%; height: 100%; max-width: 180px; border: 0; border-radius: 0; background: transparent; object-fit: contain; object-position: center; transition: transform 140ms ease; }
.anomaly-recruit-identity { display: grid; gap: 4px; min-width: 0; width: 100%; }
.anomaly-recruit-identity > strong { font-size: var(--ga-font-body); line-height: 1.4; overflow-wrap: anywhere; }
.anomaly-recruit-identity > span { color: var(--muted); font-size: var(--ga-font-note); line-height: 1.4; overflow-wrap: anywhere; }
.anomaly-recruit-cost { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); color: var(--gold-strong); background: linear-gradient(135deg, #d4b45e12, transparent); }
.anomaly-recruit-cost > strong { font-size: var(--ga-font-body); }
.anomaly-recruit-cost > span { font-size: var(--ga-font-note); white-space: nowrap; }
.anomaly-recruit-card .anomaly-recruit-detail { margin: 0 8px; }
.anomaly-recruit-card .anomaly-recruit-detail > summary { justify-content: space-between; gap: 4px; color: var(--text); }
.anomaly-recruit-card .anomaly-recruit-detail[open] > summary > span { transform: rotate(180deg); }
.anomaly-recruit-card .anomaly-recruit-detail p { overflow-wrap: anywhere; }
.anomaly-recruit-card .anomaly-legacy-companion { margin: 4px 8px; }
.anomaly-recruit-guide { margin-block: 4px; }
.anomaly-recruit-guide > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-recruit-guide > summary::before { content: "›"; margin-right: 8px; }
.anomaly-recruit-guide[open] > summary::before { transform: rotate(90deg); }
@media (hover: hover) { .anomaly-recruit-select:not(:disabled):hover .actor-image { transform: translateY(-3px); } }
@media (min-width: 680px) { .abyss-anomaly-screen .limited-abyss-recruitment .limited-abyss-companion-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .abyss-anomaly-screen .limited-abyss-recruitment .limited-abyss-companion-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } .abyss-anomaly-screen .anomaly-recruit-select .limited-abyss-companion-portrait { height: 176px; } }
@media (prefers-reduced-motion: reduce) { .anomaly-recruit-select .actor-image { transition: none; } }
.abyss-anomaly-screen .anomaly-training { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 8px; align-items: center; }
.anomaly-training .anomaly-training-portrait { width: 44px; height: 56px; }
.abyss-anomaly-screen .anomaly-training > button { grid-column: auto; padding-inline: 8px; }
.abyss-anomaly-screen .anomaly-training p { margin: 4px 0 0; font-size: var(--ga-font-note); }
.anomaly-training-detail { grid-column: 1 / -1; border-top: 1px solid var(--anomaly-line); }
.anomaly-training-detail summary, .anomaly-owned-pearls > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: var(--ga-font-body); }
.anomaly-training-detail > p { padding-bottom: 8px; }
.abyss-anomaly-screen .limited-abyss-part .limited-abyss-item-list { max-height: 32rem; overflow-y: auto; overscroll-behavior: contain; }
.anomaly-reward-open { overflow: hidden; }
.anomaly-reward-open .floor-clear-notice, .anomaly-reward-open .post-battle-actions, .anomaly-reward-open .tutorial-guide, .anomaly-reward-open .battlefield-log-panel { visibility: hidden; }
.anomaly-reward-backdrop { position: fixed; inset: 0; z-index: 170; background: transparent; display: grid; place-items: center; padding: 24px; }
.anomaly-reward-dialog { --anomaly-line: var(--ga-control-border); --anomaly-accent: #b9a0e5; display: flex; flex-direction: column; width: min(100%, 440px); max-height: calc(100dvh - 48px); padding: 12px; border: 1px solid var(--ga-control-border); border-radius: var(--ga-radius-panel); background: var(--surface); box-shadow: 0 8px 24px rgb(0 0 0 / 35%); overflow: hidden; }
.anomaly-reward-dialog.is-entering { animation: anomaly-reward-appear 200ms ease-out both; }
.anomaly-reward-dialog h2 { margin: 4px 0; font-size: var(--ga-font-section); }
.anomaly-reward-dialog:focus { outline: none; }
.anomaly-reward-dialog header, .anomaly-reward-dialog footer { text-shadow: 0 2px 3px #000, 0 0 8px #000, 0 0 16px #000; }
.anomaly-reward-dialog > header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 8px; }
.anomaly-reward-dialog > header > .anomaly-section-label { display: inline-flex; align-items: center; margin: 0; padding: 4px 8px; border: 1px solid var(--ga-control-border); border-radius: var(--ga-radius-panel); background: #111820; color: #ffe6a3; font-size: var(--ga-font-caption); line-height: 1.4; white-space: nowrap; text-shadow: none; }
.anomaly-reward-dialog > header > h2 { margin: 0; line-height: 1.4; }
.anomaly-reward-dialog header > p { margin: 4px 0 8px; font-size: var(--ga-font-note); color: var(--text); }
.anomaly-reward-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.anomaly-reward-card { min-width: 0; border: 1px solid var(--ga-control-border); border-radius: var(--ga-radius-panel); background: #141b24; }
.anomaly-reward-card.is-selected { border-color: var(--anomaly-accent); box-shadow: inset 0 0 0 1px var(--anomaly-accent); }
.anomaly-reward-card > button { display: grid; justify-items: center; align-content: start; gap: 4px; width: 100%; height: auto; min-height: 112px; padding: 8px; border: 0; background: transparent; box-shadow: none; white-space: normal; }
.anomaly-reward-type { color: var(--muted); font-size: var(--ga-font-caption); font-weight: 400; }
.anomaly-reward-card strong { font-size: var(--ga-font-body); line-height: 1.4; overflow-wrap: anywhere; }
.anomaly-reward-icon { display: grid; place-items: center; width: 32px; height: 32px; }
.anomaly-reward-icon > img, .anomaly-reward-icon > .magic-orb { width: 32px; height: 32px; }
.anomaly-reward-check { color: var(--muted); font-size: var(--ga-font-note); }
.is-selected .anomaly-reward-check { color: var(--anomaly-accent); }
.anomaly-reward-card details { border-top: 1px solid var(--ga-control-border); margin: 0 8px; }
.anomaly-reward-card summary { cursor: pointer; min-height: 44px; padding-block: 8px; font-size: var(--ga-font-note); }
.anomaly-reward-dialog .anomaly-reward-card details > p { font-size: var(--ga-font-caption); line-height: 1.55; overflow-wrap: anywhere; margin: 0 0 8px; }
.anomaly-reward-dialog footer { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 8px; margin-top: 8px; flex-shrink: 0; }
.anomaly-reward-dialog footer > .primary-button { background: transparent; border-color: var(--gold-strong); box-shadow: inset 0 0 0 1px #e2c47a33; text-shadow: inherit; }
.anomaly-reward-dialog footer > span { text-align: center; color: var(--text); font-size: var(--ga-font-note); }
.anomaly-reward-dialog footer > small { grid-column: 1 / -1; color: var(--text); font-size: var(--ga-font-note); }
@media (max-width: 600px) {
  .anomaly-reward-backdrop { padding: max(64px, env(safe-area-inset-top)) 24px max(80px, env(safe-area-inset-bottom)); }
  .anomaly-reward-dialog { max-height: calc(100dvh - 144px); }
  .anomaly-reward-card > button { min-height: 112px; padding: 8px 4px; }
}

@keyframes anomaly-reward-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .anomaly-reward-dialog.is-entering { animation: none; } }

/* A wine-red identity separates the weekly hub from the ordinary navigation. */
.abyss-anomaly-screen, .anomaly-dialog, .anomaly-reward-dialog {
  --anomaly-accent: #e0a1b3;
  --anomaly-line: #744454;
  --anomaly-surface: #261922;
  --anomaly-deep: #1b1017;
  --surface: #261922;
  --surface-2: #34212a;
  --text: #f2e5e7;
  --muted: #c2aab4;
  --input: #21131b;
  --line: var(--anomaly-line);
  --ga-control-border: var(--anomaly-line);
  --ga-control-bg: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.abyss-anomaly-screen::before { background: radial-gradient(ellipse at 50% 100%, #742b463d, transparent 70%), var(--anomaly-deep); }
.abyss-anomaly-screen > .page-heading { --heading-crystal: 211 140 163; background: linear-gradient(125deg, #442331, #21131b 80%); }
/* Keep the weekly heading on one compact row, including narrow screens. */
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title.page-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; margin: 0; padding: 6px 8px; }
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title .page-heading-main { grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; }
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title .page-heading-icon { width: 24px; height: 24px; margin: 0; }
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title .page-heading-icon > * { width: 24px; height: 24px; }
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title .page-heading-copy h1 { margin: 0; font-size: var(--ga-font-section); line-height: 1.4; white-space: nowrap; }
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title .page-heading-meta { justify-self: end; justify-content: flex-end; width: auto; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; white-space: nowrap; }
.abyss-anomaly-screen[data-anomaly] > .limited-abyss-title .page-heading-meta > .tag { width: auto; font-size: var(--ga-font-note); line-height: 1.4; white-space: nowrap; }
.abyss-anomaly-screen > .panel { background: linear-gradient(130deg, var(--surface-2), var(--anomaly-surface)); }
.abyss-anomaly-screen .anomaly-feature { background: radial-gradient(ellipse at 100% 45%, #a64b681a, transparent 70%), linear-gradient(130deg, #34212a, #21131b); }
.abyss-anomaly-screen .anomaly-portal { border-color: var(--anomaly-line); background: var(--anomaly-deep); }
.abyss-anomaly-screen .anomaly-portal::before { background: linear-gradient(90deg, #2c101ee6, #2c101e1a 90%), linear-gradient(0deg, #21131bf2, transparent 75%); }
.abyss-anomaly-screen .anomaly-week-strip, .abyss-anomaly-screen .anomaly-overview { background: linear-gradient(110deg, #3b202d, var(--anomaly-surface)); }
.abyss-anomaly-screen .anomaly-ranking .is-mine { background: #e0a1b31a; }
.anomaly-dialog { border-color: var(--anomaly-line); border-top-color: var(--anomaly-accent); background: var(--anomaly-surface); }
.anomaly-reward-card { background: #241820; }

/* Reserve the dock in the page flow so the last control can scroll above it. */
html:has(.abyss-anomaly-screen > .anomaly-tabs) {
  --anomaly-navigation-height: 110px;
  --anomaly-navigation-bottom: env(safe-area-inset-bottom, 0px);
}
body:has(.abyss-anomaly-screen > .anomaly-tabs) main {
  padding-bottom: calc(var(--anomaly-navigation-height) + var(--anomaly-navigation-bottom) + 24px);
}
html:has(.abyss-anomaly-screen > .anomaly-tabs) {
  scroll-padding-block: calc(var(--app-header-height) + 8px) calc(var(--anomaly-navigation-height) + var(--anomaly-navigation-bottom) + 24px);
}
.abyss-anomaly-screen:has(> .anomaly-tabs) { padding-bottom: 0; }
.abyss-anomaly-screen > .anomaly-tabs {
  position: fixed;
  z-index: 45;
  inset: auto auto var(--anomaly-navigation-bottom) 50%;
  transform: translateX(-50%);
  width: min(100%, 980px);
  height: var(--anomaly-navigation-height);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(44px, 1fr));
  gap: 4px;
  margin: 0;
  padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
  border: 0;
  border-top: 2px solid #ad657d;
  border-radius: 0;
  background: linear-gradient(180deg, #3c1a2a, #24111d);
  box-shadow: 0 -8px 24px #0005;
}
.abyss-anomaly-screen > .anomaly-tabs button {
  min-height: 44px;
  padding: 4px 8px;
  font-size: var(--ga-font-control);
  line-height: 1.4;
  color: #e1c4ce;
  border: 1px solid #754153;
  background: linear-gradient(180deg, #482334, #331925);
  box-shadow: inset 0 1px #ffffff0a;
}
.abyss-anomaly-screen > .anomaly-tabs button.selected {
  color: #fff0e5;
  border-color: #d89aaf;
  background: linear-gradient(180deg, #79354f, #5a253e);
  box-shadow: inset 0 -2px #efbdca, inset 0 1px #ffffff1a;
}
body:has(.abyss-anomaly-screen > .anomaly-tabs) .global-chat {
  bottom: calc(var(--anomaly-navigation-bottom) + var(--anomaly-navigation-height));
}
@media (max-width: 700px) {
  html:has(.abyss-anomaly-screen > .anomaly-tabs) { --anomaly-navigation-bottom: var(--mobile-navigation-height); }
  body:has(.abyss-anomaly-screen > .anomaly-tabs) .chat-drawer {
    bottom: calc(var(--anomaly-navigation-bottom) + var(--anomaly-navigation-height));
  }
  body:has(.abyss-anomaly-screen > .anomaly-tabs) .background-battle-monitor {
    bottom: calc(var(--anomaly-navigation-bottom) + var(--anomaly-navigation-height) + var(--mobile-chat-peek-height) + 7px);
  }
  body.background-battle-monitor-visible:has(.abyss-anomaly-screen > .anomaly-tabs) main {
    padding-bottom: calc(105px + var(--anomaly-navigation-bottom) + var(--anomaly-navigation-height) + var(--mobile-chat-peek-height));
  }
}

/* Support shop: reuse the town storefront and existing resource/item artwork. */
.abyss-anomaly-screen .anomaly-supply-card { padding: 12px; }
.anomaly-supply-heading { display: flex; align-items: center; gap: 8px; }
.anomaly-supply-heading > img { object-fit: contain; flex: 0 0 48px; }
.anomaly-supply-heading > div { min-width: 0; }
.abyss-anomaly-screen .anomaly-supply-heading h2 { margin: 4px 0 0; }
.anomaly-shop-kicker { display: block; font-size: var(--ga-font-caption); letter-spacing: .1em; color: var(--anomaly-accent); }
.anomaly-shop-kicker b { margin-left: 4px; padding: 2px 6px; border: 1px solid var(--anomaly-line); border-radius: 2px; letter-spacing: 0; color: var(--text); font-weight: 400; }
.anomaly-supply-amount { margin-left: auto; color: var(--gold-strong); font-size: 1.5rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.anomaly-supply-amount small { font-size: var(--ga-font-note); }
.anomaly-supply-amount small > span { display: block; text-align: right; color: var(--muted); font-weight: 400; }
.abyss-anomaly-screen .anomaly-supply-card > p { margin: 8px 0; font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-supply-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.abyss-anomaly-screen .anomaly-supply-actions .law-support-countdown { display: grid; align-content: center; gap: 4px; margin: 0; padding: 8px; border: 0; border-left: 2px solid var(--anomaly-line); border-radius: 0; background: var(--anomaly-deep); min-width: 0; }
.anomaly-supply-actions .law-support-countdown span { font-size: var(--ga-font-caption); }
.anomaly-supply-actions .law-support-countdown strong { font-size: var(--ga-font-note); overflow-wrap: anywhere; }
.abyss-anomaly-screen .anomaly-supply-actions button { padding-inline: 12px; min-height: 48px; }
.anomaly-shop-details { border-top: 1px solid var(--anomaly-line); }
.anomaly-shop-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer; font-size: var(--ga-font-note); color: var(--muted); list-style: none; }
.anomaly-shop-details > summary::-webkit-details-marker { display: none; }
.anomaly-shop-details > summary::after { content: '＋'; color: var(--anomaly-accent); }
.anomaly-shop-details[open] > summary::after { content: '−'; }
.abyss-anomaly-screen .anomaly-shop-details p { margin: 0 0 8px; font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-supply-card > .anomaly-shop-details { margin-top: 8px; }
.abyss-anomaly-screen .anomaly-shopfront { padding: 0; overflow: hidden; background: var(--anomaly-deep); border-color: var(--anomaly-line); }
.anomaly-shop-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px; border-bottom: 1px solid var(--anomaly-line); background: radial-gradient(ellipse at 100% 70%, #b27c3d30, transparent 65%), linear-gradient(115deg, #492335, #281722); }
.anomaly-shop-heading > div { min-width: 0; }
.abyss-anomaly-screen .anomaly-shop-heading h2 { margin: 6px 0; color: var(--text); }
.abyss-anomaly-screen .anomaly-shop-heading p { margin: 0 0 12px; color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-shop-building { object-fit: contain; width: 112px; height: 112px; flex-shrink: 0; filter: drop-shadow(0 6px 8px #140a1680); }
.anomaly-shop-wallet { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--anomaly-line); background: #1b1017b3; border-radius: var(--ga-radius-panel); font-size: var(--ga-font-note); }
.anomaly-shop-wallet img { flex: 0 0 24px; }
.anomaly-shop-wallet strong { margin-left: 4px; color: var(--text); font-size: var(--ga-font-body); font-variant-numeric: tabular-nums; }
.abyss-anomaly-screen .anomaly-shop-deadline { margin: 0; padding: 12px; display: grid; gap: 4px; font-size: var(--ga-font-body); line-height: 1.6; border-bottom: 1px solid var(--anomaly-line); background: #6a3a2726; }
.anomaly-shop-deadline strong { font-weight: 500; color: var(--gold-strong); }
.anomaly-shop-deadline span { color: var(--muted); }
.anomaly-shop-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; align-items: stretch; }
.abyss-anomaly-screen .anomaly-shop-product { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px; min-width: 0; border-top: 2px solid #a46b55; background: linear-gradient(140deg, #3b2630, var(--anomaly-surface) 65%); box-shadow: inset 0 1px #e0a1b317; }
.anomaly-product-display { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; align-items: center; }
.anomaly-product-art { display: grid; place-items: center; width: 80px; height: 88px; background: radial-gradient(ellipse, #d99f4740, transparent 70%); }
.anomaly-product-art img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 4px 4px #130b1880); }
.anomaly-product-display h3 { margin: 4px 0 !important; }
.anomaly-product-benefit { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; font-size: 1.75rem; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold-strong); }
.anomaly-product-benefit small { font-size: var(--ga-font-body); color: var(--text); font-weight: 400; }
.anomaly-product-benefit > span { padding: 3px 6px; margin-left: 4px; border: 1px solid var(--anomaly-line); background: var(--anomaly-deep); border-radius: 2px; font-size: var(--ga-font-note); color: var(--text); font-weight: 500; }
.abyss-anomaly-screen .anomaly-product-description { margin: 0; }
.anomaly-product-remaining { color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-product-remaining strong { color: var(--text); }
.anomaly-product-stock { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--anomaly-line); font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-product-stock b { color: var(--text); }
.abyss-anomaly-screen .anomaly-product-buy { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 8px; border-color: #aa725e; background: linear-gradient(#684032, #442b29); box-shadow: inset 0 1px #efc98b30, 0 2px #130a12; }
.anomaly-product-price { display: flex; align-items: center; gap: 4px; }
.anomaly-product-price img { width: 24px; height: 24px; flex-shrink: 0; }
.anomaly-product-price b { color: var(--gold-strong); }
.anomaly-product-buy i { font-style: normal; margin-left: 4px; }
.abyss-anomaly-screen .anomaly-shop-purchase-note { margin: 0; padding: 0 12px 12px; }
.anomaly-shopfront > .warning, .anomaly-shopfront > .anomaly-note:not(.anomaly-shop-purchase-note) { margin-inline: 12px; }
@media (max-width: 700px) {
  .anomaly-shop-products { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 8px; }
  .anomaly-shop-heading { padding: 12px; }
  .anomaly-shop-building { width: 88px; height: 96px; }
  .anomaly-product-display { grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
  .anomaly-product-art { width: 72px; height: 80px; }
  .anomaly-product-art img { width: 72px; height: 72px; }
}
@media (max-width: 360px) {
  .anomaly-supply-actions { grid-template-columns: minmax(0, 1fr); }
  .anomaly-shop-building { width: 68px; height: 80px; }
  .anomaly-shop-heading { gap: 4px; }
  .anomaly-product-benefit > span { margin-left: 0; }
}

/* Match the existing menu unread mark; keep the entire button clickable. */
.abyss-anomaly-screen [data-anomaly-support-notice] { position: relative; }
.abyss-anomaly-screen [data-anomaly-support-notice][data-support-claimable="true"]::before { content: ""; position: absolute; z-index: 1; top: 4px; right: 4px; width: 10px; height: 10px; border: 2px solid var(--anomaly-surface); border-radius: 50%; background: #ff4038; pointer-events: none; }

/* Seven weekly equipment slots and a part-filtered inventory dialog. */
.abyss-anomaly-screen .limited-abyss-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.abyss-anomaly-screen .anomaly-equipment-slot { display: grid; grid-template-columns: 36px minmax(0, 1fr) 8px; gap: 8px; align-items: center; min-width: 0; min-height: 88px; padding: 8px; text-align: left; }
.anomaly-equipment-slot-icon { width: 36px; height: 40px; object-fit: contain; }
.anomaly-equipment-slot > span { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.anomaly-equipment-slot small { font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-equipment-slot strong { font-size: var(--ga-font-item-name); line-height: 1.5; color: var(--text); }
.anomaly-equipment-slot em { font-size: var(--ga-font-caption); color: var(--muted); font-style: normal; }
.anomaly-equipment-slot > i { font-style: normal; color: var(--anomaly-accent); }
body:has(#anomaly-equipment-picker) { overflow: hidden; }
.anomaly-equipment-picker { width: min(100%, 560px); }
.anomaly-equipment-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.anomaly-equipment-picker-heading > div { min-width: 0; overflow-wrap: anywhere; }
.anomaly-equipment-picker-heading > button { flex: 0 0 44px; width: 44px; min-height: 44px; }
.anomaly-equipment-picker .anomaly-equipment-picker-heading h2 { margin: 0 0 4px; }
.anomaly-equipment-picker .anomaly-equipment-picker-heading p { margin: 0; font-size: var(--ga-font-note); color: var(--muted); }
.anomaly-equipment-picker .limited-abyss-part { border: 0; padding: 0; margin: 0; background: transparent; }
.anomaly-equipment-picker .limited-abyss-item-list { display: grid; gap: 12px; padding: 0; }
.anomaly-equipment-picker .limited-abyss-current-pin { position: static; z-index: auto; margin: 0; }
.anomaly-equipment-picker .limited-abyss-item { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 12px; border: 1px solid var(--anomaly-line); background: var(--anomaly-deep); }
.anomaly-equipment-picker .limited-abyss-item > * { grid-column: 1 / -1; grid-row: auto; }
.anomaly-equipment-picker .limited-abyss-item header strong, .anomaly-equipment-picker .limited-abyss-current-pin-main strong, .anomaly-equipment-picker .limited-abyss-current-pin-main em { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.anomaly-equipment-picker .limited-abyss-item header { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; }
.anomaly-equipment-picker .limited-abyss-item header > div { min-width: 0; overflow-wrap: anywhere; }
.anomaly-equipment-picker .limited-abyss-item header strong, .anomaly-equipment-picker .limited-abyss-current-pin strong { font-size: var(--ga-font-item-name); }
.anomaly-equipment-picker .limited-abyss-item p { margin: 8px 0; font-size: var(--ga-font-note); }
.anomaly-equipment-picker .limited-abyss-item header small, .anomaly-equipment-picker .limited-abyss-item header > span, .anomaly-equipment-picker .limited-abyss-current-pin em, .anomaly-equipment-picker .limited-abyss-current-pin b, .anomaly-equipment-picker .limited-abyss-current-pin small { font-size: var(--ga-font-note); }
.anomaly-equipment-picker .limited-abyss-item > button, .anomaly-equipment-picker .law-gear-upgrade { width: 100%; margin-top: 8px; min-height: 44px; }
.anomaly-equipment-picker .limited-abyss-item > .primary-button { min-height: 48px; }
.anomaly-equipment-picker-footer { flex-shrink: 0; padding-top: 12px; }
.anomaly-equipment-picker-footer > button { width: 100%; min-height: 44px; }
@media (max-width: 360px) {
  .abyss-anomaly-screen .anomaly-equipment-slot { grid-template-columns: 28px minmax(0, 1fr); gap: 4px; }
  .anomaly-equipment-slot-icon { width: 28px; height: 36px; }
  .anomaly-equipment-slot > i { display: none; }
}

/* Weekly party roster: three visible seats, shared wine-red controls. */
.abyss-anomaly-screen .anomaly-preparation > summary,
.abyss-anomaly-screen .anomaly-reserves > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; font-size: var(--ga-font-section); }
.anomaly-preparation > summary::-webkit-details-marker, .anomaly-reserves > summary::-webkit-details-marker { display: none; }
.anomaly-preparation > summary > span, .anomaly-reserves > summary > span { margin-left: auto; color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-preparation > summary > i { font-style: normal; color: var(--anomaly-accent); }
.anomaly-preparation[open] > summary > i { transform: rotate(180deg); }
.anomaly-preparation-body { padding-top: 8px; }
.anomaly-party-list { display: grid; gap: 8px; }
.abyss-anomaly-screen .anomaly-party-card { min-width: 0; padding: 8px; border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); background: var(--anomaly-deep); }
.anomaly-party-person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.anomaly-party-person > div:not(.anomaly-party-rows) { flex: 1; min-width: 0; }
.anomaly-party-person small { font-size: var(--ga-font-caption); color: var(--anomaly-accent); }
.abyss-anomaly-screen .anomaly-party-person h3 { font-size: var(--ga-font-body); margin: 2px 0; overflow-wrap: anywhere; line-height: 1.4; }
.abyss-anomaly-screen .anomaly-party-person p { font-size: var(--ga-font-note); margin: 0; color: var(--muted); }
.anomaly-party-portrait, .anomaly-party-empty-mark { display: grid; place-items: center; width: 48px; height: 56px; flex: 0 0 48px; overflow: hidden; }
.anomaly-party-portrait img { width: 48px; height: 56px; object-fit: contain; }
.anomaly-party-empty-mark { color: var(--anomaly-accent); border: 1px dashed var(--anomaly-line); border-radius: 2px; font-size: 1.5rem; }
.anomaly-party-rows { display: flex; flex-shrink: 0; gap: 4px; }
.abyss-anomaly-screen .anomaly-party-rows button { padding: 4px 8px; min-height: 44px; font-size: var(--ga-font-note); }
.anomaly-party-arts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.abyss-anomaly-screen .anomaly-party-art { display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 44px; padding: 4px; text-align: left; }
.anomaly-party-art > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; }
.anomaly-party-art img, .anomaly-party-art svg { max-width: 24px; max-height: 24px; }
.anomaly-party-art small { font-size: var(--ga-font-note); line-height: 1.4; overflow-wrap: anywhere; }
.anomaly-party-replace { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: var(--ga-font-note); }
.anomaly-party-replace select { flex: 1; min-width: 0; min-height: 44px; }
.anomaly-party-detail { margin-top: 4px; }
.anomaly-party-detail > summary, .anomaly-formation-help > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; font-size: var(--ga-font-note); color: var(--muted); }
.abyss-anomaly-screen .anomaly-party-detail p, .abyss-anomaly-screen .anomaly-formation-help p { font-size: var(--ga-font-note); }
.anomaly-party-detail > button { width: 100%; margin-block: 4px; }
.anomaly-party-card.is-empty > button { width: 100%; margin-top: 8px; }
.anomaly-formation-help { margin-top: 4px; }
.anomaly-reserves > .anomaly-party-list { margin-top: 8px; }
.anomaly-reserves > button { width: 100%; }
@media (min-width: 1000px) {
 .anomaly-party-list { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 360px) {
 .anomaly-party-portrait, .anomaly-party-empty-mark { width: 40px; flex-basis: 40px; }
 .anomaly-party-rows { gap: 2px; }
 .anomaly-party-person { gap: 6px; }
 .anomaly-party-art { flex-direction: column; text-align: center; }
}
/* The active-art picker inherits this week's palette and keeps descriptions readable. */
.abyss-anomaly-screen .limited-abyss-command-picker-backdrop { background: #09060cdd; backdrop-filter: blur(4px); }
.abyss-anomaly-screen .limited-abyss-command-picker-dialog { background: var(--anomaly-surface); border: 1px solid var(--anomaly-line); border-radius: var(--ga-radius-panel); box-shadow: 0 16px 48px #000a; max-height: calc(100dvh - 16px); }
.abyss-anomaly-screen .limited-abyss-command-picker-heading { padding: 12px; border-bottom: 1px solid var(--anomaly-line); background: var(--anomaly-deep); }
.abyss-anomaly-screen .limited-abyss-command-picker-title { gap: 8px; }
.abyss-anomaly-screen .limited-abyss-command-picker-title .abyss-mechanism-mark { width: 28px; height: 28px; flex-basis: 28px; }
.abyss-anomaly-screen .limited-abyss-command-picker-title .abyss-mechanism-gear { width: 28px; height: 28px; }
.abyss-anomaly-screen .limited-abyss-command-picker-title p, .abyss-anomaly-screen .limited-abyss-command-picker-title small { display: none; }
.abyss-anomaly-screen .limited-abyss-command-picker-title h2 { font-size: var(--ga-font-section); font-family: inherit; letter-spacing: 0; overflow-wrap: anywhere; }
.abyss-anomaly-screen .limited-abyss-command-picker-close { width: 44px; height: 44px; flex-basis: 44px; border-radius: var(--ga-radius-control); background: var(--anomaly-surface); border-color: var(--anomaly-line); }
.abyss-anomaly-screen .limited-abyss-command-picker-dialog > p { padding: 8px 12px; font-size: var(--ga-font-note); color: var(--muted); }
.abyss-anomaly-screen .limited-abyss-command-options { padding: 8px; min-height: 0; gap: 8px; grid-auto-rows: max-content; align-content: start; }
.abyss-anomaly-screen .limited-abyss-command-option { padding: 8px; gap: 8px; grid-template-columns: 32px minmax(0, 1fr) 20px; border-color: var(--anomaly-line); border-radius: var(--ga-radius-control); background: var(--anomaly-deep); }
.abyss-anomaly-screen .limited-abyss-command-option.selected { background: var(--anomaly-raised, #492b37); border-color: var(--anomaly-accent); }
.abyss-anomaly-screen .limited-abyss-command-option:disabled { opacity: .6; }
.abyss-anomaly-screen .limited-abyss-command-option-icon { width: 32px; height: 32px; border-radius: 2px; }
.abyss-anomaly-screen .limited-abyss-command-option-icon .command-icon { width: 28px; height: 28px; }
.abyss-anomaly-screen .limited-abyss-command-option-copy strong { white-space: normal; overflow: visible; font-size: var(--ga-font-item-name); overflow-wrap: anywhere; }
.abyss-anomaly-screen .limited-abyss-command-option-copy > small { display: block; overflow: visible; font-size: var(--ga-font-note); line-height: 1.5; color: var(--muted); }
.abyss-anomaly-screen .limited-abyss-command-option-meta { flex-wrap: wrap; }
.abyss-anomaly-screen .limited-abyss-command-option-meta b, .abyss-anomaly-screen .limited-abyss-command-option-meta i, .abyss-anomaly-screen .limited-abyss-command-option-copy em { font-size: var(--ga-font-caption); }
.abyss-anomaly-screen .limited-abyss-command-option-state { width: 20px; height: 20px; }
.abyss-anomaly-screen .limited-abyss-command-picker-dialog > footer { padding: 8px 12px; border-top: 1px solid var(--anomaly-line); background: var(--anomaly-deep); flex-shrink: 0; }
.abyss-anomaly-screen .limited-abyss-command-picker-dialog > footer span, .abyss-anomaly-screen .limited-abyss-command-picker-dialog > footer small { font-size: var(--ga-font-caption); }

/* Weekly battle chrome: mode-scoped identity, with skill/status colors intact. */
.anomaly-battle, body.anomaly-battle-active {
  --anomaly-accent: #e0a1b3;
  --anomaly-line: #744454;
  --anomaly-surface: #261922;
  --anomaly-deep: #1b1017;
}
.anomaly-battle :is(.battle-header, .command-dock, .post-battle-actions, .battlefield-log-panel) { --battle-deck-crystal: 224 161 179; }
.anomaly-battle .battle-header {
  border-color: var(--anomaly-line);
  background: radial-gradient(ellipse at 10% 0%, #ae46652b, transparent 60%), linear-gradient(110deg, #492535fa, #281722fa 68%, #351c2afa);
}
.anomaly-battle .battle-header :is(.eyebrow, .battle-difficulty-label) { color: #e0a1b3; }
.anomaly-battle .battle-header .battle-phase-label { color: #ddc4cd; }
.anomaly-battle .battle-header .battle-round-label:not(.round-limit-warning):not(.round-limit-critical) { color: #e5bdcc; border-color: var(--anomaly-line); background: #6a30423d; }
.anomaly-battle .battle-header .battle-utility-controls :is(.battle-loot-button, .battle-speed-trigger) { border-color: var(--anomaly-line); background: #301a26; color: #f2e5e7; }
.anomaly-battle .battle-header .battle-auto-group:not(.auto-on):not(.auto-stop-pending) { border-color: #a86a80; background: linear-gradient(#633446, #351c29); }
.anomaly-battle .battle-header .battle-auto-group:not(.auto-on):not(.auto-stop-pending) .battle-auto-button { background: transparent; }
.anomaly-battle .battle-header .battle-auto-settings-button { border-left-color: #a86a8066; }
.anomaly-battle .command-dock { border-top-color: var(--anomaly-line); background: radial-gradient(ellipse at 50% 0%, #a64b682b, transparent 55%), linear-gradient(#321c29fa, #1b1017fc); }
.anomaly-battle .command-dock .command-button:not(.rule-forbidden),
.anomaly-battle .command-dock[class*="party-color-"] .command-button:not(.rule-forbidden) {
  border-color: var(--anomaly-line);
  background: radial-gradient(ellipse at 50% 0%, #ad4d6b24, transparent 65%), linear-gradient(#482a38fa, #23131dfc);
  box-shadow: inset 0 1px #f7d3df12, 0 5px 13px #0004;
}
.anomaly-battle .command-dock .command-button::after { background: linear-gradient(90deg, transparent, #e0a1b34d, transparent); }
.anomaly-battle .command-dock .command-button .command-meta { color: #c7a9b6; }
.anomaly-battle .command-dock .command-button:not(:disabled):is(:hover, :focus-visible, .support-pending) { border-color: #f0cc88; background: linear-gradient(#61364afa, #321b28fc); box-shadow: inset 0 1px #fff2, 0 0 0 1px #e0a1b344; }
.anomaly-battle :is(.post-battle-actions.result-actions-only, .battlefield-log-panel) { border-color: var(--anomaly-line); background: linear-gradient(#321e29fa, #1b1017fc); }
.anomaly-battle :is(.battle-log-dialog, .battle-item-picker-dialog), body.anomaly-battle-active :is(.battle-speed-dialog, .battle-tactics-dialog) { border-color: var(--anomaly-line); background: linear-gradient(145deg, #3b2230, #21141d 75%); }
.anomaly-battle .battle-auto-scope-menu { border-color: var(--anomaly-line); background: var(--anomaly-deep); }
.anomaly-battle .battle-auto-scope-menu [aria-pressed="true"], body.anomaly-battle-active .battle-speed-option.selected { border-color: #b7778f; background: #633446; }
body.anomaly-battle-active .battle-speed-option:not(.selected) { border-color: var(--anomaly-line); background: var(--anomaly-deep); }
body.anomaly-battle-active :is(.tactics-heading, .tactics-member, .tactics-scope) { border-color: var(--anomaly-line); background: #291923; }
body.anomaly-battle-active :is(.tactics-policy, .tactics-scope-options button) { border-color: var(--anomaly-line); background: var(--anomaly-deep); }
body.anomaly-battle-active :is(.tactics-policy, .tactics-scope-options button)[aria-pressed="true"] { border-color: #d4a170; background: #603447; }
body.anomaly-battle-active .tactics-apply { border-color: #b7778f; background: linear-gradient(#754153, #482735); }
@media (max-width: 700px) {
  .anomaly-battle.battle-shell .battle-header .battle-progress-title { grid-template-columns: minmax(34px, .9fr) minmax(0, 1.3fr) auto; }
  .anomaly-battle.battle-shell .battle-header .battle-floor-label { grid-column: 1; grid-row: 1; }
  .anomaly-battle.battle-shell .battle-header .battle-difficulty-label { grid-column: 2 / -1; grid-row: 1; }
  .anomaly-battle.battle-shell .battle-header .battle-phase-heading { grid-column: 1 / 3; grid-row: 2; }
}

/* Anomaly party-wide equipment rank; normal tower styles are unchanged. */
.abyss-anomaly-screen .anomaly-rank-summary{display:flex;align-items:center;gap:.75rem;padding:.8rem 0}
.abyss-anomaly-screen .anomaly-rank-icon{width:2.5rem;height:2.5rem;object-fit:contain}
.abyss-anomaly-screen .anomaly-rank-summary>div{flex:1;min-width:0}
.abyss-anomaly-screen .anomaly-rank-summary small{display:block;font-size:var(--ga-font-note);color:var(--muted)}
.abyss-anomaly-screen .anomaly-rank-summary strong{font-size:var(--ga-font-page);color:#f4d190}
.abyss-anomaly-screen .anomaly-rank-summary i{font-style:normal;color:#bba3ad}
.abyss-anomaly-screen .anomaly-rank-summary em{font-style:normal;color:#fff2d2}
.abyss-anomaly-screen .anomaly-equipment-rank>.primary-button{width:100%}
.abyss-anomaly-screen .anomaly-rank-guide{margin-top:.75rem;font-size:var(--ga-font-note)}
.abyss-anomaly-screen .anomaly-rank-guide summary{cursor:pointer;padding:.5rem 0}
.abyss-anomaly-screen .anomaly-rank-steps>div{display:grid;grid-template-columns:2.5rem 1fr auto;gap:.5rem;padding:.45rem .25rem;border-bottom:1px solid #61404e}
.abyss-anomaly-screen .anomaly-rank-steps .is-complete{color:#bba3ad}

/* Party growth: scoped wine-red panels, readable at large text sizes. */
.abyss-anomaly-screen .anomaly-strength-members{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.abyss-anomaly-screen .anomaly-strength-members button{flex:1 1 120px;min-width:0;overflow-wrap:anywhere}
.abyss-anomaly-screen .anomaly-strength-name{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;font-size:var(--ga-font-section);margin:12px 0 8px}
.abyss-anomaly-screen .anomaly-strength-name small{font-size:var(--ga-font-note);color:var(--muted);font-weight:400}
.abyss-anomaly-screen .anomaly-strength-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:8px 0 12px}
.abyss-anomaly-screen .anomaly-strength-stats>div{display:flex;flex-direction:column;gap:4px;padding:8px;border:1px solid var(--anomaly-line,#80505c);border-radius:4px;background:rgba(15,10,15,.6);min-width:0;overflow-wrap:anywhere}
.abyss-anomaly-screen .anomaly-strength-stats span,.abyss-anomaly-screen .anomaly-strength-stats small{font-size:var(--ga-font-note)}
.abyss-anomaly-screen .anomaly-strength-stats strong{font-size:var(--ga-font-section)}
.abyss-anomaly-screen .anomaly-strength-stats small{color:var(--muted)}
.abyss-anomaly-screen .anomaly-strength-stats small b{color:#edd0a0;display:inline-block}
@media(max-width:360px){.abyss-anomaly-screen .anomaly-strength-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}

.abyss-anomaly-screen .anomaly-enemy-preview>summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;align-items:center;min-height:44px;cursor:pointer}
.abyss-anomaly-screen .anomaly-enemy-preview>summary span{font-size:var(--ga-font-note);color:var(--muted)}
.abyss-anomaly-screen .anomaly-enemy-preview article{padding:8px 0;border-top:1px solid var(--anomaly-line,#80505c);min-width:0;overflow-wrap:anywhere}
.abyss-anomaly-screen .anomaly-enemy-preview-heading{display:flex;align-items:center;gap:8px}
.abyss-anomaly-screen .anomaly-enemy-preview-heading img{width:48px;height:48px;object-fit:contain;flex:none}
.abyss-anomaly-screen .anomaly-enemy-preview-heading strong{flex:1;min-width:0;font-size:var(--ga-font-body)}
.abyss-anomaly-screen .anomaly-enemy-preview article p,.abyss-anomaly-screen .anomaly-enemy-preview dl{font-size:var(--ga-font-note)}
.abyss-anomaly-screen .anomaly-enemy-preview article summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:var(--ga-font-note)}
.abyss-anomaly-screen .anomaly-enemy-preview dt{font-weight:700;margin-top:8px}
.abyss-anomaly-screen .anomaly-enemy-preview dd{margin:4px 0;color:var(--muted)}
.abyss-anomaly-screen .anomaly-enemy-preview>summary::after,.abyss-anomaly-screen .anomaly-enemy-preview article summary::after{content:"⌄";margin-left:auto;flex:none}
.abyss-anomaly-screen .anomaly-enemy-preview[open]>summary::after,.abyss-anomaly-screen .anomaly-enemy-preview article details[open]>summary::after{transform:rotate(180deg)}

.abyss-anomaly-screen .anomaly-rank-guide > summary { display: flex; align-items: center; min-height: 44px; }
@media (max-width: 700px) {
  .abyss-anomaly-screen .anomaly-week-strip { padding-right: 48px; }
}
.abyss-anomaly-screen .anomaly-rank-guide > summary::after { content: "⌄"; flex: none; margin-left: auto; }
.abyss-anomaly-screen .anomaly-rank-guide[open] > summary::after { transform: rotate(180deg); }

@media (max-height: 500px) and (pointer: coarse) {
  body:has(.abyss-anomaly-screen > .anomaly-tabs) .chat-drawer { bottom: var(--mobile-navigation-height); }
}

@media (min-width: 701px) and (max-height: 500px) and (pointer: coarse) {
  body:has(.abyss-anomaly-screen > .anomaly-tabs) .chat-drawer { bottom: 0; }
}

/* The expedition reuses the anomaly cards and the shared facility controls. */
.expedition-screen .expedition-actions { display: grid; gap: 8px; margin-top: 16px; }
.expedition-screen summary { min-height: 44px; padding-block: 8px; box-sizing: border-box; cursor: pointer; }
.expedition-screen .expedition-character { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px; min-width: 0; }
.expedition-screen .expedition-character > span:first-child { flex: 0 0 56px; width: 56px; height: 64px; overflow: hidden; }
.expedition-screen .expedition-character img { width: 100%; height: 100%; object-fit: contain; }
.expedition-screen .expedition-character > span:last-child { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.expedition-screen .expedition-character small { font-size: var(--ga-font-note); }
.expedition-screen .expedition-candidate { min-width: 0; }
.expedition-screen .expedition-candidate > button { width: 100%; }
.expedition-screen .expedition-candidate summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: var(--ga-font-note); }
.expedition-screen .expedition-candidate p { overflow-wrap: anywhere; font-size: var(--ga-font-note); }
.expedition-screen .expedition-party-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-block: 16px; }
.expedition-screen .expedition-party-overview > div { display: grid; justify-items: center; text-align: center; min-width: 0; overflow-wrap: anywhere; }
.expedition-screen .expedition-party-overview > div > span { height: 72px; width: 64px; }
.expedition-screen .expedition-party-overview img { width: 100%; height: 100%; object-fit: contain; }
.expedition-screen .expedition-reset { margin-top: 12px; width: 100%; }
.expedition-screen .expedition-member { min-width: 0; overflow-wrap: anywhere; }
.expedition-screen .expedition-member > p > img { width: 40px; height: 40px; object-fit: contain; }
.expedition-screen .expedition-pearl-slots { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.expedition-screen .expedition-pearl-slot { border: 1px solid var(--ga-control-border); padding: 4px; border-radius: var(--ga-radius-panel); min-width: 0; }
.expedition-screen .expedition-pearl-slot summary { display: grid; justify-items: center; gap: 4px; min-height: 64px; cursor: pointer; overflow-wrap: anywhere; font-size: var(--ga-font-note); }
.expedition-screen .expedition-pearl-slot p { font-size: var(--ga-font-note); }
.expedition-screen .expedition-pearl-slot .magic-orb { width: 32px; height: 32px; }
.expedition-screen .expedition-party-selection .limited-abyss-companion-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
.expedition-reward .expedition-assignment { padding: 8px; display: grid; gap: 8px; min-width: 0; }
.expedition-reward .expedition-assignment label { display: grid; gap: 4px; min-width: 0; font-size: var(--ga-font-note); }
.expedition-reward .expedition-assignment select { min-width: 0; width: 100%; min-height: 44px; font-size: max(1rem,16px); }
.expedition-reward .expedition-assignment p { margin: 0; overflow-wrap: anywhere; font-size: var(--ga-font-note); }
.expedition-reward .anomaly-reward-card details > p { font-size: var(--ga-font-note); }
.expedition-reward .anomaly-reward-grid { align-items: start; }
.expedition-reward header { display: block; }
.expedition-reward header > span { font-size: var(--ga-font-note); }
.expedition-reward footer { grid-template-columns: minmax(0,1fr); }
.expedition-reward footer p { margin: 0; font-size: var(--ga-font-note); overflow-wrap: anywhere; }
.expedition-reward footer > .primary-button { min-height: 48px; }
@media (min-width: 701px) {
  .expedition-screen .expedition-party-selection .limited-abyss-companion-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .expedition-reward .anomaly-reward-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

/* Reward selection leaves the global navigation and update controls usable. */
.anomaly-reward-backdrop { pointer-events: none; }
.anomaly-reward-dialog { pointer-events: auto; }
.anomaly-reward-open #site-header, .anomaly-reward-open #navigation,
.anomaly-reward-open #update-prompt, .anomaly-reward-open #global-chat { z-index: 171; }
.anomaly-reward-dialog footer > .anomaly-reward-dismiss { grid-column: 1 / -1; width: 100%; min-height: 44px; }

.anomaly-reward-backdrop { --anomaly-reward-top: calc(var(--app-header-height, 46px) + 64px); --anomaly-reward-bottom: 24px; padding: var(--anomaly-reward-top) 24px var(--anomaly-reward-bottom); }
body.app-update-available .anomaly-reward-backdrop { --anomaly-reward-top: calc(var(--app-header-height, 46px) + var(--app-update-flow-space, 42px) + 64px); }
.anomaly-reward-dialog { max-height: calc(100dvh - var(--anomaly-reward-top) - var(--anomaly-reward-bottom)); }
@media (max-width: 700px) {
  .anomaly-reward-backdrop { --anomaly-reward-top: max(58px, calc(var(--app-header-height, 46px) + 12px)); --anomaly-reward-bottom: max(80px, calc(var(--mobile-navigation-height, 62px) + 16px)); }
  body.app-update-available .anomaly-reward-backdrop { --anomaly-reward-top: calc(var(--app-header-height, 46px) + var(--app-update-flow-space, 42px) + 12px); }
}

/* Expedition allocation uses the shared controls, with local option lists. */
.expedition-reward .expedition-picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; min-width: 0; padding: 8px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.expedition-reward .expedition-picker-trigger > span { flex-shrink: 0; }
.expedition-reward .expedition-option-list { display: grid; grid-auto-rows: max-content; align-content: start; gap: 4px; max-height: min(300px, 45dvh); overflow-y: auto; overscroll-behavior: contain; min-width: 0; padding: 4px; border: 1px solid var(--ga-control-border); background: var(--surface-deep); }
.expedition-reward .expedition-option { display: grid; gap: 4px; height: auto; width: 100%; min-width: 0; min-height: 48px; padding: 8px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.expedition-reward .expedition-option small { font-size: var(--ga-font-note); }
.expedition-reward .expedition-option[aria-selected="true"] { border-color: var(--gold-strong); box-shadow: inset 0 0 0 1px var(--gold-strong); }

/* Keep the six candidates separate from allocation, on an opaque surface. */
.expedition-reward { position: relative; width: min(100%, 600px); gap: 8px; }
.expedition-reward > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; text-shadow: none; flex-shrink: 0; }
.expedition-reward > header > div { min-width: 0; }
.expedition-reward > header span { font-size: var(--ga-font-note); color: var(--muted); }
.expedition-reward > header h2 { margin: 2px 0 0; font-size: var(--ga-font-body); line-height: 1.35; }
.expedition-reward > header .anomaly-reward-dismiss { min-height: 44px; padding: 4px 8px; flex-shrink: 0; }
.expedition-reward .expedition-choice-grid { flex-shrink: 0; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; overflow: visible; }
.expedition-choice-grid .anomaly-reward-card { position: relative; }
.expedition-choice-grid .anomaly-reward-card > button:not(.expedition-reward-info-button) { min-height: 104px; padding: 4px; gap: 2px; }
.expedition-choice-grid .anomaly-reward-type, .expedition-choice-grid .anomaly-reward-icon { justify-self: start; }
.expedition-choice-grid .anomaly-reward-icon, .expedition-choice-grid .anomaly-reward-icon > img, .expedition-choice-grid .anomaly-reward-icon > .magic-orb { width: 24px; height: 24px; }
.expedition-choice-grid .anomaly-reward-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; justify-self: start; font-size: var(--ga-font-item-name); line-height: 1.35; text-align: left; word-break: keep-all; }
.expedition-reward-art { display: inline-grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; }
.expedition-reward-art > img, .expedition-reward-art > .magic-orb:not(.empty) { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.expedition-choice-grid .expedition-reward-art { width: 36px; height: 36px; justify-self: start; }
.expedition-reward-art > img { filter: drop-shadow(0 2px 3px color-mix(in srgb, var(--surface-deep), transparent 25%)); }
.expedition-choice-grid .expedition-reward-summary { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; width: 100%; height: 5em; color: var(--text); font-size: var(--ga-font-note); font-weight: 400; line-height: 1.25; text-align: left; white-space: pre-line; overflow-wrap: anywhere; }
.expedition-choice-grid .expedition-reward-summary.is-gear { display: block; height: auto; min-height: 5em; overflow: visible; }
.expedition-choice-grid .anomaly-reward-check { position: absolute; top: -5px; left: -4px; padding-inline: 2px; border-radius: 50%; background: var(--surface); line-height: 1; }
.expedition-choice-grid .anomaly-reward-check:empty { display: none; }
.expedition-reward .expedition-reward-info-button { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; box-shadow: none; color: var(--text); background: transparent; font-size: 1.125rem; }
.expedition-reward .expedition-allocation-grid { grid-template-columns: minmax(0,1fr); align-content: start; grid-auto-rows: max-content; }
.expedition-reward .expedition-assignment { padding: 8px; }
.expedition-reward .expedition-assignment h3 { margin: 0; font-size: var(--ga-font-body); overflow-wrap: anywhere; }
.expedition-allocation-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.expedition-allocation-heading > div { min-width: 0; }
.expedition-reward > footer { gap: 4px; margin: 0; text-shadow: none; }
.expedition-reward > footer p, .expedition-reward > footer small { margin: 0; }
.expedition-reward > footer > .secondary-button { min-height: 44px; }
.expedition-reward .expedition-reward-info { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--surface); }
.expedition-reward-info > header { display: flex; align-items: center; gap: 8px; text-shadow: none; }
.expedition-reward-info h3 { flex: 1; min-width: 0; margin: 0; font-size: var(--ga-font-section); overflow-wrap: anywhere; }
.expedition-reward-info > header button { flex-shrink: 0; min-width: 44px; min-height: 44px; }
.expedition-reward-info > [data-scroll-region] { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.expedition-reward-info p { margin: 0; font-size: var(--ga-font-body); line-height: 1.6; overflow-wrap: anywhere; }
.expedition-reward-info > .primary-button { flex-shrink: 0; min-height: 48px; }
@media (max-width: 700px) {
  .anomaly-reward-backdrop:has(>.expedition-reward) { padding-inline: 8px; }
  .expedition-reward { padding: 8px; gap: 6px; }
}
@media (max-height: 560px) {
  .expedition-reward { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .expedition-reward > header { margin-bottom: 8px; }
  .expedition-reward > footer { margin-top: 8px; }
  .expedition-reward .anomaly-reward-grid { overflow: visible; }
}
