/* Interface Alignment 01. The sea layout is isolated from ship, harbor and dialogs.
   The original chart coordinates, artwork, renderer and steering are unchanged. */
.chart-voyages,.world-reputation,.log-open{display:none}
.voyage-log{padding-left:22px;font-size:14px;line-height:1.6}
.voyage-log li{margin:0 0 10px}

@media (min-width:620px){
  body:has(#gameUI[data-screen="sea"]:not([hidden])){
    --captain-width:clamp(222px,20vw,264px);
    --ocean-chrome:368px;
  }
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .shell{
    max-width:min(1480px,calc((100dvh - var(--ocean-chrome)) * 10 / 7 + var(--captain-width) + 64px));
    padding:0 16px;
  }
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .masthead{
    min-height:44px;padding:5px 0;gap:12px;margin-bottom:0;
  }
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .brandseal{width:30px;height:30px;font-size:21px}
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .brandmark{gap:8px}
  body:has(#gameUI[data-screen="sea"]:not([hidden])) h1{font-size:23px;margin-top:2px}
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .studio{font-size:8px}
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .top-meta{font-size:10px;max-width:45%;gap:3px;overflow-wrap:anywhere}
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .prototype{font-size:9px}
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .footer{padding:6px 0;font-size:8px;gap:10px;line-height:1.5}

  #gameUI[data-screen="sea"] .mobile-status{display:none}
  #gameUI[data-screen="sea"] .main-grid{
    grid-template-columns:minmax(0,1fr) var(--captain-width);
    grid-template-rows:auto auto;align-items:start;gap:8px 12px;margin:8px 0;
  }
  #gameUI[data-screen="sea"] .stage-shell{
    grid-column:1;grid-row:1;order:0;min-width:0;padding:8px;
    display:grid;grid-template-columns:minmax(0,1fr) 140px;
    grid-template-rows:auto auto minmax(44px,auto) 88px;gap:8px;
    border-radius:9px;box-shadow:none;
  }
  #gameUI[data-screen="sea"] .tabs{grid-column:1/-1;grid-row:1;padding:0;border:0;gap:4px}
  #gameUI[data-screen="sea"] .tabs button{min-height:34px;padding:5px 8px;border-radius:5px;font-size:10px}
  #gameUI[data-screen="sea"] #seaView,
  #gameUI[data-screen="sea"] .navigation-controls{display:contents}
  #gameUI[data-screen="sea"] #seaView>.view-title,
  #gameUI[data-screen="sea"] #seaView>.help-note,
  #gameUI[data-screen="sea"] .navigation-controls .help-note{display:none}
  #gameUI[data-screen="sea"] .map-frame{grid-column:1/-1;grid-row:2;border-width:2px;border-radius:5px;box-shadow:none}
  #gameUI[data-screen="sea"] #ocean{width:100%;height:auto;aspect-ratio:10/7}
  #gameUI[data-screen="sea"] .chart-voyages{
    display:block;position:absolute;right:8px;bottom:8px;pointer-events:none;
    padding:5px 7px;border:1px solid #bfa37277;border-radius:4px;background:#102e38e8;
    color:#f8e4b8;font:10px/1.2 ui-monospace,monospace;
  }
  #gameUI[data-screen="sea"] .navigation-controls>.route-info{
    grid-column:1;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) auto;
    align-content:center;align-items:center;gap:3px 6px;padding:0 3px;font-size:11px;line-height:1.3;
  }
  #gameUI[data-screen="sea"] .route-info>#routeStatus{grid-column:1;grid-row:1;font-size:11px;overflow-wrap:anywhere}
  #gameUI[data-screen="sea"] .route-info>#daysToPort{grid-column:1;grid-row:2;font-size:10px}
  #gameUI[data-screen="sea"] #dockBtn{grid-column:2;grid-row:1/3;min-height:44px;padding:7px 9px;font-size:10px;white-space:normal}
  #gameUI[data-screen="sea"] .helm{
    grid-column:2;grid-row:3/5;align-self:start;gap:4px;width:140px;
  }
  #gameUI[data-screen="sea"] .helm button{min-width:0;min-height:44px;height:44px;padding:5px;border-radius:5px;box-shadow:none}
  #gameUI[data-screen="sea"] .helm button svg{width:22px;height:22px}
  #gameUI[data-screen="sea"] .helm .rose{font-size:27px}
  #gameUI[data-screen="sea"] .narrative{
    grid-column:1;grid-row:4;position:relative;min-width:0;padding:8px;
    border:1px solid #caa87744;border-radius:5px;height:88px;
  }
  #gameUI[data-screen="sea"] .narrative-title{font-size:9px;letter-spacing:0;padding-right:66px;gap:5px}
  #gameUI[data-screen="sea"] .narrative p{font-size:12px;line-height:1.4;margin:8px 0 0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
  #gameUI[data-screen="sea"] .recent-log{display:none}
  #gameUI[data-screen="sea"] .log-open{
    display:flex;position:absolute;inset:0;justify-content:flex-end;align-items:flex-start;
    width:100%;padding:7px 8px;background:transparent;border:0;border-radius:5px;
    color:#ead09e;font:10px/1.5 ui-monospace,monospace;text-align:right;
  }
  #gameUI[data-screen="sea"] .log-open:hover{background:#ffffff08}

  #gameUI[data-screen="sea"] .instrument-panel{display:contents;position:static}
  #gameUI[data-screen="sea"] .captain-panel{
    grid-column:2;grid-row:1;min-width:0;padding:10px;
    border:1px solid #b69b6c77;border-radius:9px;background:#10313c;
  }
  #gameUI[data-screen="sea"] .panel-heading{min-height:15px}
  #gameUI[data-screen="sea"] .panel-heading h2,
  #gameUI[data-screen="sea"] .panel-heading #voyageCounter{display:none}
  #gameUI[data-screen="sea"] .panel-heading .eyebrow{font-size:9px;letter-spacing:.06em}
  #gameUI[data-screen="sea"] .meters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:9px 0 10px}
  #gameUI[data-screen="sea"] .meter{gap:3px;text-align:center}
  #gameUI[data-screen="sea"] .meter-icon{order:0;font-size:20px;line-height:24px}
  #gameUI[data-screen="sea"] .meter-title{order:1;min-height:22px;font-size:10px;line-height:11px;display:flex;align-items:center;justify-content:center;flex-wrap:wrap}
  #gameUI[data-screen="sea"] .meter-tube{order:2;height:64px;width:28px;border-radius:4px}
  #gameUI[data-screen="sea"] .meter-value{order:3;font-size:15px;line-height:18px}
  #gameUI[data-screen="sea"] .meter-value small{font-size:9px;line-height:11px;margin:0}
  #gameUI[data-screen="sea"] .crew-glance{padding:7px 0 5px}
  #gameUI[data-screen="sea"] .crew-heading{font-size:10px;letter-spacing:0;margin-bottom:7px}
  #gameUI[data-screen="sea"] .stat-mini{grid-template-columns:45px 1fr 35px;font-size:11px;margin:7px 0;gap:6px}
  #gameUI[data-screen="sea"] .cargo-count{padding:6px 0;background:transparent;font-size:10px;line-height:14px;border-radius:0}
  #gameUI[data-screen="sea"] .critical-warning{font-size:11px;line-height:1.35;padding:6px;margin:0 0 8px}
  #gameUI[data-screen="sea"] .report-buttons{display:grid;grid-template-columns:1fr;gap:7px;margin:4px 0 0}
  #gameUI[data-screen="sea"] #reportsBtn{font-size:11px;min-height:44px;padding:7px 8px;border-radius:5px}
  #gameUI[data-screen="sea"] .parrot-button{min-height:44px;padding:6px 8px;border-radius:5px;gap:8px}
  #gameUI[data-screen="sea"] .parrot-button .parrot-illustration{font-size:27px}
  #gameUI[data-screen="sea"] .parrot-button b{font-size:11px}
  #gameUI[data-screen="sea"] .parrot-button small{font-size:10px;margin-top:3px}
  #gameUI[data-screen="sea"] .parrot-speech{
    font-size:12px;line-height:1.35;min-height:0;height:48px;padding:7px 8px;margin:7px 0 0;
    border-radius:5px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
  }
  #gameUI[data-screen="sea"] .toggle-row{min-height:44px;gap:6px;font-size:10px;line-height:1.25;margin:0}
  #gameUI[data-screen="sea"] .toggle-row input{flex-shrink:0;margin:0;width:18px;height:18px}
  #gameUI[data-screen="sea"] .toggle-row .tiny{display:none}
  #gameUI[data-screen="sea"] .world-reputation{
    display:flex;flex-direction:column;gap:3px;min-height:37px;padding:6px 7px;
    border:1px dashed #8fa7a066;border-radius:4px;color:#b4c7c3;font:10px/1.2 ui-monospace,monospace;
  }
  #gameUI[data-screen="sea"] .world-reputation small{font-size:9px;color:#90aaa5}

  #gameUI[data-screen="sea"] .voyage-tools{
    grid-column:1/-1;grid-row:2;display:flex;align-items:center;gap:10px;min-width:0;
    padding:0 2px;
  }
  #gameUI[data-screen="sea"] .save-actions{display:flex;gap:6px;margin:0;flex-shrink:0}
  #gameUI[data-screen="sea"] .save-actions .button{min-height:44px;font-size:10px;padding:7px 10px;border-radius:5px}
  #gameUI[data-screen="sea"] .save-status{flex:1;min-width:0;font-size:9px;line-height:1.4;margin:0;overflow-wrap:anywhere}
  #gameUI[data-screen="sea"] .bottom-actions{gap:4px;margin:0;flex-shrink:0}
  #gameUI[data-screen="sea"] .text-link{min-height:44px;padding:6px;font-size:10px}
}

@media (min-width:620px) and (max-width:800px){
  body:has(#gameUI[data-screen="sea"]:not([hidden])) .shell{max-width:100%;padding:0 10px}
  #gameUI[data-screen="sea"] .main-grid{gap:8px}
  #gameUI[data-screen="sea"] .stage-shell{grid-template-columns:minmax(0,1fr) 140px;padding:6px;gap:7px}
  #gameUI[data-screen="sea"] .navigation-controls>.route-info{display:block;padding:0}
  #gameUI[data-screen="sea"] #dockBtn{margin-top:5px}
  #gameUI[data-screen="sea"] .narrative-title{padding-right:0;flex-wrap:wrap}
  #gameUI[data-screen="sea"] .log-open{padding-top:4px;align-items:flex-end;font-size:9px}
  #gameUI[data-screen="sea"] .narrative p{-webkit-line-clamp:2;font-size:11px;margin-top:5px}
  #gameUI[data-screen="sea"] .save-status{font-size:8px}
  #gameUI[data-screen="sea"] .voyage-tools{gap:5px}
}

@media (min-width:620px) and (max-height:820px){
  #gameUI[data-screen="sea"] .meters{margin:6px 0 7px}
  #gameUI[data-screen="sea"] .meter-tube{height:48px}
  #gameUI[data-screen="sea"] .captain-panel{padding:8px 10px}
  #gameUI[data-screen="sea"] .crew-glance{padding:5px 0 3px}
  #gameUI[data-screen="sea"] .world-reputation{min-height:32px;padding:4px 7px}
}

@media (prefers-reduced-motion:reduce){.meter-fill{transition:none}}

/* rc8: compact progression readout; existing chart and controls retain their layout. */
.ship-progression{display:grid;gap:3px;padding:6px 0;font-size:11px;line-height:1.4}
.ship-progression strong{font-weight:600;color:#f0d8a8}
.ship-progression small{font-size:10px;color:#b4c7c3}

/* Only the requested parrot reply: temporary speech balloon inside the existing dialog. */
#parrotBtn,#mobileParrot{min-height:44px}
.parrot-reply{position:relative;margin:10px 0 20px;padding:12px 15px;border:1px solid #bbab82;border-radius:18px;background:#0a2832}
.parrot-reply::after{content:'';position:absolute;bottom:-9px;left:28px;width:16px;height:16px;background:#0a2832;border-right:1px solid #bbab82;border-bottom:1px solid #bbab82;transform:rotate(45deg)}
#modalBody .parrot-reply p{margin:0;font-style:italic}
