body.world-page { background: #575f56; overflow: hidden; }
body.voyage-ended { background: #303b37; overflow: hidden; }
.voyage-ended :is(.topbar, .workspace, .toast) { visibility: hidden; }
.voyage-ended dialog { border-top: 3px solid var(--seal); }
.voyage-ended dialog::backdrop { background: #172a249e; }
.voyage-ended .folio-quote { white-space: pre-line; overflow-wrap: anywhere; }
body.world-page::before, .world-page .masthead, .world-page .desk-header,
.world-page .sidebar, .world-page .footer { display: none; }
.world-page .topbar { height: 56px; background: #efeadc; }
.world-page .top-inner { max-width: none; padding-inline: clamp(14px, 3vw, 38px); }
.world-page .workspace { max-width: none; padding: 0; }
.world-page .desk { margin: 0; }
.world-page .desk-grid { display: block; }
.world-page .main-panel:is(.sea-panel,.deck-panel) {
  height: calc(100dvh - 56px);
  min-height: 0;
  border: 0;
  overflow: hidden;
}
.sea-panel { background: #667871; }
.sea-world, .sea-overlay { position: absolute; inset: 0; }
.sea-world > canvas { display: block; width: 100%; height: 100%; }
.sea-view-canvas.is-orbit-view {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sea-view-canvas.is-orbit-view.is-orbit-dragging { cursor: grabbing; }
.sea-view-canvas:focus-visible { outline: 2px solid #e2c89d; outline-offset: -4px; }
.sea-overlay { pointer-events: none; }
.sea-overlay :is(button,a,select), .deck-world-actions, .sea-station { pointer-events: auto; }
.sea-ink {
  color: #282c25;
  background: #f3eddeed;
  box-shadow: 0 4px 20px #192a2b21;
  border: 1px solid #e3d9c3;
}
.sea-voyage {
  position: absolute;
  top: clamp(14px, 3vw, 33px);
  left: clamp(14px, 3vw, 38px);
  padding: 13px 16px 12px;
  width: min(calc(100% - 28px), 320px);
}
.sea-voyage p:first-child { color: #78372a; font-size: 12px; letter-spacing: .08em; }
.sea-voyage h2 { font: 700 clamp(24px, 3vw, 35px)/1.2 var(--kai); margin-block: 3px 4px; }
.sea-voyage small { display: block; color: #47594f; font-size: 12px; }
.sea-wind { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #40564a; font-size: 12px; }
.sea-wind .ui-icon { width: 16px; height: 16px; flex: none; }
.sea-wind b { white-space: nowrap; }
.sea-voyage .sea-wind-trend { margin-top: 3px; color: #78372a; }
.sea-voyage .sea-shore-supply { margin-top: 6px; }
.sea-voyage .sea-wind-trend[hidden], .sea-voyage .sea-shore-supply[hidden] { display: none; }
.sea-dials {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 0;
  border-top: 1px solid #c9bfaa;
  padding-top: 8px;
}
.sea-dials dt { color: #625d53; font-size: 11px; }
.sea-dials dd { margin: 2px 0 0; font: 700 17px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
#sea-depth { font-size: .95rem; }
.sea-place-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sea-place-line .btn { flex: none; min-width: 44px; min-height: 36px; padding-inline: 8px; }
@media (pointer: coarse) {
  .sea-place-line .btn { min-height: 44px; }
}
.sea-view-modes {
  position: absolute;
  top: clamp(14px, 3vw, 33px);
  right: clamp(14px, 3vw, 38px);
  display: flex;
  gap: 4px;
  padding: 5px;
}
.sea-view-modes .btn { min-height: 34px; padding: 4px 8px; }
.sea-orbit-hint {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  padding: 5px 8px;
  white-space: nowrap;
  font-size: 12px;
  color: #f6edda;
  background: #28362be8;
  border: 1px solid #e1d0ac7c;
}
.sea-orbit-swipe { display: none; }
@media (pointer: coarse) {
  .sea-orbit-drag { display: none; }
  .sea-orbit-swipe { display: inline; }
}
.sea-station {
  position: absolute;
  bottom: clamp(15px, 3vw, 31px);
  left: 50%;
  width: min(740px, calc(100% - 26px));
  transform: translateX(-50%);
  padding: 9px;
}
.sea-station .sea-primary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sea-station .sea-primary:first-child { border-bottom: 1px solid #d5cbb7; padding-bottom: 7px; margin-bottom: 7px; }
.sea-station .btn, .sea-station select { min-height: 35px; }
.sea-station select { color: var(--ink); background: var(--paper-high); border: 1px solid var(--line); padding-inline: 4px; }
.sea-station .sea-command { margin-left: auto; }
.sea-station .sailing-difficulty { grid-template-columns: auto auto; }
.sea-sail-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.speed-controls {
  display: grid;
  align-items: center;
  grid-template-columns: auto minmax(42px, 1fr) auto;
  gap: 3px;
  background: #e6ddc9;
  border: 1px solid #cbbfa6;
  border-radius: 2px;
}
.speed-controls[hidden], .sea-sail-controls[hidden], .touch-sail[hidden] { display: none; }
.speed-order { padding-inline: 3px; text-align: center; color: #3d544b; font-size: 13px; white-space: nowrap; }
.sea-station .speed-step { min-width: 35px; padding: 3px; border-color: transparent; font-size: 18px; }
.sea-keys { margin-top: 5px; font-size: 12px; color: #5a574d; }
.sea-overlay .btn[aria-pressed="true"], .deck-world-actions .btn[aria-pressed="true"] {
  background: #475c50;
  color: #fff9eb;
  border-color: #475c50;
}
.sea-notice {
  position: absolute;
  bottom: clamp(167px, 19dvh, 205px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 30px);
}
.sea-notice .btn { background: #ece4cf; color: #62372b; }
.deck-world-actions {
  z-index: 2;
  position: absolute;
  right: clamp(13px, 3vw, 35px);
  top: clamp(13px, 2vw, 25px);
  max-width: min(calc(100% - 118px), 465px);
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
}
.deck-world-actions .btn { min-height: 34px; padding: 5px 8px; }
.world-page .deck-panel > .wd-scene { height: 100%; }
.world-page .toast { bottom: 150px; }
.sea-proposal { display: grid; gap: 8px; }
.sea-proposal textarea {
  width: 100%;
  min-height: 6em;
  resize: vertical;
  border: 1px solid var(--line);
  padding: 8px;
  background: var(--paper-high);
  color: var(--ink);
  font: inherit;
}
.sea-proposal textarea:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.sea-proposal .row { align-items: center; }
.sea-attendees { padding: 4px 0; color: var(--muted); }
.sea-attendees summary { cursor: pointer; }
.sea-attendees label { display: inline-flex; align-items: center; gap: 3px; margin-right: 5px; }
.sea-order { padding: 9px 11px; border-left: 2px solid var(--seal); background: #eae1d0; }
.sea-order > * + * { margin-top: 5px; }
@media (max-width: 760px) {
  .world-page .topbar { height: 89px; }
  .world-page .top-inner { padding-block: 5px; }
  .world-page .main-panel:is(.sea-panel,.deck-panel) { height: calc(100dvh - 89px); }
  .sea-station .sea-command { margin-left: 0; }
  .sea-station .btn { padding-inline: 6px; gap: 4px; }
  .sea-view-modes {
    top: auto;
    bottom: max(160px, 24dvh);
    right: 12px;
    flex-wrap: wrap;
  }
  .sea-notice { bottom: max(205px, 32dvh); }
  .sea-voyage { padding: 8px 11px; }
}
@media (min-width: 601px) and (max-width: 760px) and (min-height: 541px) {
  .sea-orbit-hint { top: auto; bottom: calc(100% + 5px); }
}
@media (max-height: 560px) and (min-width: 761px) {
  .sea-voyage { top: 10px; }
  .sea-station { bottom: 8px; }
  .sea-view-modes { top: 10px; }
}
