/* Compact voyage instruments and independent chart/chat interactions. */
#gauges { padding: 9px 12px; max-height: calc(100dvh - 24px); overflow: auto; pointer-events: auto; overscroll-behavior: contain; }
#gauges #topL { position: static; padding: 0 0 8px; margin-bottom: 8px; border-bottom: 1px solid #b496634d; font-weight: 600; line-height: 1.35; }
#gauges #topL .big { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topL small { display: block; font-size: 10.5px; }
#pSub { margin: 2px 0 4px; }
.voyage-account { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 11px; }
#cash { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wallet { flex-shrink: 0; margin: 0; font-size: 10px; }
#wallet b { font-size: 13px; margin-left: 2px; font-variant-numeric: tabular-nums; }
#wx, #online { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#online:empty { display: none; }
#spd { font-size: 32px; }
#gauges .row { margin-top: 4px; font-size: 12px; }
#windc { width: 42px; height: 42px; flex-shrink: 0; }
#sw { top: 12px; }
#toasts { width:max-content; max-width:calc(100vw - 24px); z-index:20; }
#toasts .toast { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:center; }
#help { width: 320px; max-width: calc(100vw - 24px); max-height: max(100px, calc(100dvh - var(--mini-panel-height, 250px) - 150px)); overflow-x: hidden; overflow-y: auto; overflow-wrap: break-word; pointer-events: auto; overscroll-behavior: contain; }
#prompt { bottom: 130px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: calc(100vw - 24px); }

#chat { pointer-events: auto; }
#chatLog { max-height: 170px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; overflow-anchor: none; scrollbar-width: thin; user-select: text; scroll-behavior: auto; }
#chatLog:focus-visible, #mini:focus-visible { outline: 2px solid var(--helm-brass); outline-offset: 2px; }
#chatLog div { margin-top: 4px; padding: 5px 8px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
#chatLog time { float: right; margin: 2px 0 0 8px; font-size: 9px; color: var(--helm-muted); font-variant-numeric: tabular-nums; }
#chatLatest { position: absolute; right: 8px; bottom: 38px; padding: 4px 9px; font-size: 11px; border-radius: 12px; box-shadow: 0 2px 8px #0008; }
#chatLatest[hidden] { display: none; }
#chatIn { font-size: 12px; }

#mapbox { width: auto; max-width: calc(100vw - 24px); pointer-events: auto; padding: 5px; line-height: 1.2; }
#mapbox canvas { display: block; max-width: 100%; touch-action: none; }
.mini-toolbar { display: flex; align-items: center; gap: 4px; margin-bottom: 5px; height: 24px; }
#mapbox .mini-toolbar span { flex: 1; margin: 0; text-align: left; padding-left: 2px; font-size: 10px; letter-spacing: .1em; color: var(--helm-brass); }
.mini-toolbar button { padding: 0; width: 24px; height: 24px; line-height: 20px; font-size: 17px; background: #253429; color: var(--helm-ink); border: 1px solid #8a7957; box-shadow: none; border-radius: 5px; }
.mini-toolbar button:active { transform: none; }
#miniResize { cursor: nwse-resize; touch-action: none; }
.mini-footer { display: flex; justify-content: space-between; margin-top: 4px; }
#mapbox .mini-footer span { margin: 0; font-size: 10px; }
#mapbox #attr { font-size: 8px; text-align: center; }
body #reportTerrain { bottom: calc(var(--mini-panel-height, 250px) + 22px) !important; }
@media (max-width: 959px) {
 #chat { left: 154px; right: 12px; top: 54px; bottom: auto; width: min(340px, calc(100vw - 166px)); }
 #chatLog { max-height: clamp(40px, calc(100dvh - var(--gauge-height, 350px) - 180px), 150px); }
}
@media (max-width: 600px) {
 #gauges { width: min(270px, calc(100vw - 180px)); padding: 8px; }
 #gauges #topL .big { font-size: 12px; }
 #gauges .row { font-size: 11px; }
 #topL small { font-size: 10px; }
 #chat { left: 140px; width: calc(100vw - 152px); }
 #chatLog div { font-size: 11px; }
 #mapbox #attr { font-size: 7px; }
 #mapbox .mini-footer span { font-size: 8px; }
 #sw button { width: 116px; }
}
