/* Bottom interaction strip: a readable width even in portrait. */
body.online #message,body.online #notice{font-size:12px;line-height:1.45;text-align:center;padding:6px 10px;white-space:normal;word-break:keep-all;overflow-wrap:break-word;overflow:hidden}
/* The pack's border-image includes an opaque fill; remove it, not text opacity. */
body.online #message,body.online #notice,body.online.pack-ui #message,body.online.pack-ui #notice{border-image:none;border:1px solid var(--ui-hud-a18-message-notice-message-border);border-radius:10px;background:var(--ui-hud-a18-message-notice-message-background);color:var(--ui-hud-a18-message-notice-message-text);text-shadow:0 1px 2px var(--ui-hud-a18-message-notice-message-text-shadow);box-shadow:none;pointer-events:none}
/* A310: 사망 글은 지도·이름표 위에서도 읽히는 불투명 HUD 판에 둔다. */
body.online #down,body.online.pack-ui #down{border-image:none;background:var(--ui-hud-a48-exit-choice-background);color:var(--ui-hud-a18-message-notice-message-text);border:1px solid var(--ui-hud-combat-down-border);padding:12px 16px;line-height:1.5;text-shadow:none;box-shadow:none;z-index:8}
body #dialogue,body #dialogue.has-quest{top:auto;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(940px,calc(100vw - 24px));max-height:min(42dvh,230px);display:block;padding:10px 14px;overflow:auto;z-index:8}
body #dialogue .dialogue-copy{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:8px 12px;align-items:center}
body #dialogue-portrait{float:none;width:48px;height:48px;margin:0;grid-column:1;grid-row:1/3}
body #dialogue-text{grid-column:2/-1;min-height:0;margin:0;font-size:13px;line-height:1.5;word-break:keep-all;overflow-wrap:break-word}
body #dialogue .dialogue-actions{grid-column:2/-1;display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
body #dialogue button{margin:0;font-size:12px;padding:7px 12px;min-height:36px}
body:not(.desktop-ui) #dialogue button{min-height:44px}
body #dialogue-quest{margin:6px 0 0;padding:6px 0 0;border-left:0;border-top:1px solid var(--ui-panel-a18-dialogue-quest-border-top)}
body #dialogue-quest summary{display:flex;align-items:center;gap:10px;justify-content:space-between}
body #dialogue-quest h3{font-size:12px;margin:0}
body #dialogue-quest .quest-card{margin:0;background:none;padding:0}
body #shop-panel{position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(680px,94vw);max-height:88dvh;overflow:auto;z-index:10;padding:14px;background:var(--ui-panel-a18-shop-panel-background);color:var(--ui-panel-a18-shop-panel-text);border:9px solid transparent;border-image:var(--pack-panel) 7 fill / 9px / 0 stretch}
#shop-panel .panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:-14px;z-index:2;background:var(--ui-panel-a18-shop-panel-panel-heading-background);padding:8px 0}#shop-panel h2{font-size:18px;margin:0}
.shop-tabs{display:flex;gap:8px;margin:10px 0}.shop-tabs button[aria-pressed=true]{outline:2px solid var(--ui-panel-a18-shop-tabs-true-focus)}
#shop-panel #shop-sell-tabs:not([hidden]){display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}#shop-panel .shop-category{display:flex;align-items:center;gap:6px;min-height:44px}#shop-panel .shop-category[aria-pressed=true]{outline:2px solid var(--ui-panel-a18-shop-tabs-true-focus)}html body #shop-panel .shop-category-count{font-size:12px;color:inherit}
#shop-panel .shop-actions{flex-wrap:wrap}#shop-panel .shop-actions :is(button,input){min-height:44px;box-sizing:border-box;max-width:100%}html body #shop-panel input.sell-quantity{border-image:none;border:1px solid var(--ui-panel-line);border-radius:8px;background:var(--ui-panel-bg);color:var(--ui-panel-fg);padding:8px}#shop-panel .shop-heading h3{min-width:0;overflow-wrap:anywhere}#shop-panel .shop-sell-all{white-space:nowrap}
#shop-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.shop-card{background:var(--ui-panel-a18-shop-card-background);border:1px solid var(--ui-panel-a18-shop-card-border);padding:10px;border-radius:8px;min-width:0}
.shop-card.locked{background:var(--ui-panel-a18-shop-card-locked-background);color:var(--c-warning-a18-shop-card-locked-text)}.shop-restrictions{display:flex;gap:5px;flex-wrap:wrap;margin:7px 0 2px}.shop-badge{display:inline-flex;padding:2px 7px;border:1px solid var(--ui-panel-a18-shop-badge-border);border-radius:999px;background:var(--ui-panel-a18-shop-badge-background);color:var(--ui-panel-a18-shop-badge-text);font-size:11px;font-weight:700}.shop-badge.locked{border-color:var(--ui-panel-a18-shop-badge-locked-border-color);background:var(--ui-panel-a18-shop-badge-locked-background);color:var(--c-warning-a18-shop-badge-locked-text)}.shop-card.locked .shop-actions button{filter:saturate(.7)}
.shop-heading{display:flex;align-items:center;gap:8px}.shop-heading h3{font-size:13px;margin:0}.shop-card p{font-size:12px;line-height:1.5}.shop-card button{font-size:12px;min-height:40px}.shop-card .missing{color:var(--c-danger-a18-shop-card-missing-text)}.shop-actions{display:flex;gap:6px}.sell-quantity{width:70px;font-size:16px;min-width:0}#shop-result{min-height:1.5em;font-size:12px}
.shop-comparison{margin:8px 0;padding:8px;border-radius:6px;background:var(--ui-panel-a18-shop-comparison-background);color:var(--ui-panel-a18-shop-comparison-text);min-width:0;overflow-wrap:break-word}.shop-comparison small{display:block;font-size:11px;line-height:1.5}.shop-comparison p{margin:2px 0}.shop-comparison .gain{color:var(--c-success-a18-shop-comparison-gain-text)}.shop-comparison .loss{color:var(--c-danger-a18-shop-comparison-loss-text)}
.shop-effect{margin:8px 0;padding:8px;border-radius:6px;background:var(--ui-panel-a18-shop-effect-background);color:var(--ui-panel-a18-shop-effect-text);min-width:0;overflow-wrap:break-word}.shop-effect small{display:block;max-width:none;font-size:11px;line-height:1.5}.shop-effect .shop-owned{margin-top:4px;padding-top:4px;border-top:1px solid var(--ui-panel-a18-shop-effect-shop-owned-border-top);color:var(--ui-panel-a18-shop-effect-shop-owned-text)}
.recipe-level{font-size:12px}.recipe-level.locked{color:var(--c-warning-a18-recipe-level-locked-text)}
@media(orientation:portrait){body #dialogue,body #dialogue.has-quest{max-height:32dvh}body #dialogue .dialogue-copy{grid-template-columns:40px minmax(0,1fr)}body #dialogue-portrait{width:40px;height:40px}body #dialogue-text{font-size:12px}#shop-list{grid-template-columns:1fr}}
/* F128: 일본어는 낱말 사이 빈칸이 없어 keep-all 이면 문장 하나가 한 덩어리가 되어 아무 데서나(。 앞에서도) 끊긴다. 한국어만 keep-all(F103 a48.css :lang(ko) 와 같은 방식) */
html:lang(ja) body #dialogue-text,html:lang(ja) body.online #message,html:lang(ja) body.online #notice{word-break:normal}
/* A119: 일본어는 ー·작은 가나(ッ·ョ·ャ…) 앞에서 줄을 바꾸지 않는다(금칙). line-break:strict 가 normal 과 다른 곳은 이 글자들(CJ) 앞뿐이라 다른 끊는 자리·크기·자리는 그대로. 알림·보상 줄(혼자 보고 "…ゼリ/ー")·의뢰 보상 줄·소식 창(#update-notes, 줄 목록·쪽 표시 "1 / 3ペ/ージ")만(기술 이름은 a48.css). A121: 주운 물건 카드(#loot-toast)도 넣는다 — 휴대폰 카드 폭을 넓혀(a47-mobile.css) 320 에서도 이름이 두 줄 자르기 안에 든다 */
html:lang(ja) :is(#message,#notice,#rewards,#loot-toast,.quest-reward,#update-notes){line-break:strict}
/* A119: 소식 창 한국어는 낱말 가운데(바라/보는·이전 기/록)에서 끊지 않는다 — F103·F128 처럼 html:lang(ko) 에만(일본어는 빈칸이 없어 keep-all 금지). 한 낱말이 폭보다 길 때만 overflow-wrap 으로 넘치지 않게 끊는다 */
html:lang(ko) :is(#update-notes,#update-notes button){word-break:keep-all;overflow-wrap:break-word}
/* A308: ja 창의 짧은 이름은 한 덩어리. 본문은 Safari normal+strict, 지원 브라우저는 문절 단위. ko·지도·HUD·임무 규칙은 그대로. */
html:lang(ja) body :is(dialog,[role=dialog],#start-screen):not(#map-panel,#quest-panel,#missions-panel) :is(button,label,h1,h2,h3,h4,strong,th,.item-name,.shop-badge,[role=tab]){word-break:keep-all!important;overflow-wrap:normal!important;line-break:strict}
html:lang(ja) body :is(dialog,[role=dialog],#start-screen):not(#map-panel,#quest-panel,#missions-panel) :is(p,li,small,[role=status]){word-break:normal;overflow-wrap:normal;line-break:strict}
html:lang(ja) body :is(#dialogue-text,#message,#notice,#rewards,#loot-toast,.quest-reward,#update-notes){word-break:normal;overflow-wrap:normal;line-break:strict}
@supports(word-break:auto-phrase){
 html:lang(ja) body :is(dialog,[role=dialog],#start-screen):not(#map-panel,#quest-panel,#missions-panel) :is(p,li,small,[role=status]){word-break:auto-phrase}
 html:lang(ja) body :is(#dialogue-text,#message,#notice,#rewards,#loot-toast,.quest-reward,#update-notes){word-break:auto-phrase}
}
html:lang(ja) body :is(dialog,[role=dialog]):not(#map-panel,#quest-panel,#missions-panel) :is(.item-info-heading h3,#bag-use-name){font-size:12px}
html:lang(ja) body #key-help{word-break:keep-all!important;overflow-wrap:normal!important}
/* A308: 언어 두 칸과 출처는 밝은 판의 기존 역할색만 사용. */
body #options-panel #options-group-language .language-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body #options-panel #options-group-language button{min-width:44px;min-height:44px;text-align:center;font-size:14px;background:var(--ui-panel-menu-soft);color:var(--ui-panel-menu-fg);border:1px solid var(--ui-panel-menu-line);border-radius:12px;box-shadow:none}
body #options-panel #options-group-language button[aria-pressed=true]{background:var(--ui-panel-menu-accent);color:var(--ui-panel-menu-accent-fg);border-color:var(--ui-panel-menu-accent)}
body #options-panel #credits-link{font-size:12px;min-height:44px}
/* F230: 한국어 낱말 가운데 줄바꿈(여/행자의·사용/하며·일/어납니다·의뢰/를) — 전역 금지, 네 화면 글 상자만: 상점 비교·효과 칸 · 이야기 기록 본문(#story-journal 만, 같은 class 의 결말 창은 아님) · 요리 도움말 · 죽음 안내. ja 는 F128 처럼 그대로. 한 낱말이 폭보다 길 때만 overflow-wrap 으로 끊는다 */
html:lang(ko) :is(.shop-comparison,.shop-effect,#story-journal .story-journal-copy,#cook-help,#down){word-break:keep-all;overflow-wrap:break-word}
/* F235: 미션 칸 글 상자(줄 단추·빈 칸 글)도 ko 만 낱말 단위 줄바꿈(852 "수/련" 꺾임) — ja 는 넣지 않음(F128) */
html:lang(ko) #missions-list :is(.mission-row,p){word-break:keep-all;overflow-wrap:break-word}
