/* Site22 bridge: retain native dialogs, latest novice copy, and V26 semantic wrappers. */
.game-viewport[data-title-lobby-v12] .character-stage { display:block; }
.game-viewport[data-title-lobby-v12] .character-stage>.character-figure { display:contents; position:static; flex:none; }
.game-viewport[data-title-lobby-v12] .character-stage .character-caption { display:block; margin-top:0; }
.game-viewport[data-title-lobby-v12] .character-caption-text { min-width:0; }
.game-viewport[data-title-lobby-v12] .character-caption-text .hero-profession { display:block; margin-right:0; font-size:var(--oa-fs-caption); }
.game-viewport[data-title-lobby-v12] .character-caption-text h2 { display:block; margin:0; font-size:var(--oa-fs-display-name); line-height:1.2; }
.game-viewport[data-title-lobby-v12] .character-caption-text .character-meta { margin-top:2px; font-size:var(--oa-fs-caption); }
.game-viewport[data-title-lobby-v12] .novice-start-hint { grid-column:1/-1; grid-row:4; margin:0; font-size:max(13px,var(--oa-fs-caption)); line-height:1.35; color:var(--oa-ink-2); }
.game-viewport[data-layout][data-title-lobby-v12] .start-brand h1 { font-size:clamp(29px,8.4vw,40px); }
.game-viewport[data-title-lobby-v12] { --oa-mode-h:72px; }
.game-viewport[data-title-lobby-v12][data-ui-scale="large"] { --oa-mode-h:80px; }
.game-viewport[data-title-lobby-v12][data-ui-scale="max"] { --oa-mode-h:88px; }
/* R96 keeps its dismissible message in native dialog flow rather than over fields. */
.detail-dialog>.status-message { position:static; flex:none; top:auto; bottom:auto; left:auto; right:auto; width:auto; max-width:none; margin:0 8px 6px; transform:none; }
/* Native-scroll is a later user requirement and remains active in all detail panels. */
.detail-dialog>.dialog-body { overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
@media (orientation:landscape) {
  .game-viewport[data-layout][data-title-lobby-v12] .start-brand h1 { font-size:clamp(28px,4.6vw,64px); }
}
@media (orientation:portrait) and (max-height:700px), (orientation:landscape) and (max-height:430px) {
  .game-viewport[data-title-lobby-v12] .character-caption-text h2 { font-size:var(--oa-fs-emph); }
}
/* Cancel the legacy bottom anchor when the new notice uses a top anchor. */
body[data-control-hand]>.status-message#status-message { bottom:auto; height:auto; max-height:120px; }
/* Site22 live Worker follow-up: preserve native messages without stretching between top and bottom. */
body[data-control-hand]>.status-message { top:calc(env(safe-area-inset-top) + var(--oa-top-h) + 16px); bottom:auto; left:12px; right:12px; width:auto; max-width:none; transform:none; }
.game-viewport[data-title-lobby-v12] .start-actions>.status-message { grid-column:1/-1; grid-row:1; }
#game-viewport #status-message-dismiss { width:48px; min-width:48px; height:48px; min-height:48px; }
/* Thumb-mode legacy descendants had explicit 10px text that defeated inherited tokens. */
body[data-control-hand] .game-viewport[data-layout][data-title-lobby-v12] .departure-actions { width:100%; max-width:none; margin:0; }
body[data-control-hand] .game-viewport[data-layout][data-title-lobby-v12] .departure-actions button { font-size:var(--oa-fs-primary); }
body[data-control-hand] .game-viewport[data-layout][data-title-lobby-v12] .departure-actions .coop-button { font-size:var(--oa-fs-emph); }
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav button>span:not(.friend-request-badge) { font-size:max(13px,var(--oa-fs-tab)); line-height:1.15; white-space:normal; overflow-wrap:anywhere; word-break:normal; }
/* Preserve test-mode-link for lifecycle code; practice is available from the lobby menu after entry. */
.game-viewport[data-layout][data-title-lobby-v12] .mode-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
.game-viewport[data-title-lobby-v12] #test-mode-link { display:none; }
/* Resource delivery V18 returns a picture element for the main chip. */
.game-viewport[data-layout][data-title-lobby-v12] .support-dock>button>picture { position:absolute; inset:5px; display:block; width:auto; height:auto; }
.game-viewport[data-layout][data-title-lobby-v12] .support-dock>button>picture>img { display:block; width:100%; height:100%; object-fit:contain; }
body[data-control-hand="left"] .game-viewport[data-layout][data-title-lobby-v12] .departure-actions { grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); }
/* A 320px landscape viewport retains 92px departure, all six tabs and five formation targets. */
@media (orientation:landscape) and (max-height:340px) {
  .game-viewport[data-layout][data-title-lobby-v12] { --oa-top-h:48px; --oa-tab-h:50px; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen,
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#lobby-advice[hidden]),
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner[hidden]):has(#lobby-idle-status[hidden]),
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner[hidden]):has(#lobby-idle-status[hidden]):has(#lobby-advice[hidden]) { grid-template-rows:48px minmax(0,1fr) 50px; row-gap:8px; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-advice { display:none; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-content,
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner[hidden]):has(#lobby-idle-status[hidden]):has(#lobby-advice[hidden]) .lobby-content { grid-row:2; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-nav,
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner[hidden]):has(#lobby-idle-status[hidden]):has(#lobby-advice[hidden]) .lobby-nav { grid-row:3; }
  .game-viewport[data-layout][data-title-lobby-v12] .command-panel,
  .game-viewport[data-layout][data-title-lobby-v12][data-layout="portrait"] .command-panel { grid-template-rows:48px 92px; gap:8px; }
  .game-viewport[data-layout][data-title-lobby-v12] .compact-mode-toggle,
  .game-viewport[data-layout][data-title-lobby-v12] #target-choice,
  .game-viewport[data-layout][data-title-lobby-v12] .compact-difficulty-toggle { height:48px; min-height:48px; }
  .game-viewport[data-layout][data-title-lobby-v12] .quick-target { grid-template-rows:48px; }
  /* Keep an active preparation/battle banner reachable without restoring the advice row. */
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner:not([hidden])) { grid-template-rows:48px 48px minmax(0,1fr) 50px; row-gap:4px; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner:not([hidden])) .room-shelf { grid-column:1/-1; grid-row:2; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner:not([hidden])) .lobby-content { grid-row:3; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-screen:has(#current-room-banner:not([hidden])) .lobby-nav { grid-row:4; }
  .game-viewport[data-layout][data-title-lobby-v12] .current-room-banner span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}

/* Keep localized labels inside the 92/100/108px action frames. */
body[data-control-hand] .game-viewport[data-layout][data-title-lobby-v12] .departure-actions button { padding:4px 8px; gap:2px; line-height:1.1; }
.game-viewport[data-layout][data-title-lobby-v12] .departure-actions .icon { flex:none; width:24px; height:24px; }
.game-viewport[data-layout][data-title-lobby-v12] .departure-actions button>span { min-width:0; max-width:100%; }
.game-viewport[data-layout][data-title-lobby-v12] .departure-actions button strong { line-height:1.1; }
.game-viewport[data-layout][data-title-lobby-v12] .departure-actions button small { line-height:1.1; margin-top:2px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* Two-line English/Japanese tab labels share the fixed six-tab row with 24px symbols. */
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav button { padding:2px; gap:2px; }
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav .icon { flex:none; width:24px; height:24px; }
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav button>span:not(.friend-request-badge) { max-width:100%; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* Long companion names remain in the accessible label; the chip paints at most three lines. */
.game-viewport[data-layout][data-title-lobby-v12] .support-dock .companion-selector>span { white-space:normal; word-break:normal; overflow-wrap:anywhere; line-height:1.1; max-height:3.3em; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; }
/* The title arrow has its own space beside both the account label and its detail. */
.game-viewport[data-layout][data-title-lobby-v12] .start-cta>span { max-width:calc(100% - 24px); }
.game-viewport[data-layout][data-title-lobby-v12] .start-cta small { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }

/* Six tabs fit in 296px: 49.33px each, with no inline gaps. */
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav { grid-template-columns:repeat(6,minmax(48px,1fr)); gap:0; padding-inline:0; }
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav button { min-width:48px; min-height:48px; }
.game-viewport[data-layout][data-title-lobby-v12] .lobby-nav button>span:not(.friend-request-badge) { min-width:0; }
.training-menu-entry { display:grid; gap:8px; margin:8px 0; }
.training-menu-entry>.dialog-button { width:100%; min-height:48px; }
@media (orientation:landscape) and (max-width:420px) {
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-nav button { flex-direction:column; gap:2px; }
  .game-viewport[data-layout][data-title-lobby-v12] .lobby-nav .icon { width:20px; height:20px; }
}
#detail-dialog button { min-width:48px; min-height:48px; }
#detail-dialog .dialog-close { width:max(48px,var(--oa-close-h)); height:max(48px,var(--oa-close-h)); }
.detail-dialog :is(.base-level p,.base-level strong>span,.detail-list>div,.selected-base-note,.selected-base-note small) { font-size:max(13px,var(--oa-fs-caption)); }
