/* Sjøfart fixed furniture. Globe and harbour overlay rules remain in fleet.css.
   Loads LAST: fleet.css still carries the previous page's grid, and the shell's layout must win. */
.pc-app { display: block; padding: 0; gap: 0; }
.pc-app { min-height: 100vh; background: var(--pc-ground); color: var(--pc-ink); }
.pc-top { position: fixed; inset: 0 0 auto; z-index: 30; height: 62px; min-height: 62px; display: flex; flex-wrap: nowrap; align-items: stretch; gap: 14px; padding: 0 14px 0 0; border: 0; border-bottom: var(--pc-border-hvy) solid var(--pc-ink); background: var(--pc-paper); }
.pc-top > * { align-self: center; }
.pc-top > .pc-brand { align-self: stretch; }
.pc-brand { display: flex; align-items: center; gap: 10px; background: var(--pc-shout); color: var(--pc-paper); padding: 0 16px; margin: 0; }
.pc-brand-text { display: block; }
.pc-brand-text strong { display: block; font: 20px/1 var(--pc-display); letter-spacing: .06em; text-transform: uppercase; }
.pc-brand-text span { display: none; }
.pc-room-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.pc-room-nav button { min-height: 40px; border: var(--pc-border) solid transparent; background: transparent; color: var(--pc-ink); font: 600 var(--pc-t-body)/1 var(--pc-text); }
.pc-room-nav button[aria-current='page'] { border-color: var(--pc-ink); }
.pc-kpis { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.pc-kpi-note { display: none; }
.pc-top-actions { display: flex; gap: 6px; padding: 0; align-items: center; }
.pc-top-actions .pc-btn { min-height: 40px; }
.pc-top-actions .pc-account-trigger { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* The rail's hull rows */
.pc-rail .pc-vessels { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pc-rail .pc-vcard { display: grid; gap: 6px; width: 100%; text-align: left; padding: 10px; background: var(--pc-paper); color: var(--pc-ink); border: var(--pc-border) solid var(--pc-ink); cursor: pointer; }
.pc-rail .pc-vcard[aria-pressed='true'] { border-width: var(--pc-border-hvy); padding: 9px; background: var(--pc-ground); }
.pc-rail .pc-vcard--alert { border-left: 6px solid var(--pc-alert); }
.pc-rail .pc-vcard-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pc-rail .pc-vcard-name { font: 15px/1.1 var(--pc-display); }
.pc-rail .pc-status { font: 500 var(--pc-t-eyebrow)/1.3 var(--pc-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pc-ink-2); text-align: right; }
.pc-rail .pc-vcard-sub { font: 600 var(--pc-t-micro)/1.3 var(--pc-text); color: var(--pc-ink); }
.pc-rail .pc-mini { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; font: 500 var(--pc-t-eyebrow)/1 var(--pc-mono); letter-spacing: .12em; color: var(--pc-ink-3); }
.pc-rail .pc-mini-bar { display: block; height: 8px; border: 1px solid var(--pc-ink); background: var(--pc-ground); }
.pc-rail .pc-mini-bar i { display: block; height: 100%; background: var(--pc-data); }

.pc-rail, .pc-queue { position: fixed; top: 62px; bottom: 0; z-index: 20; overflow: auto; background: var(--pc-paper); border-color: var(--pc-ink); border-style: solid; }
.pc-rail { left: 0; width: var(--pc-rail); border-width: 0 var(--pc-border-hvy) 0 0; padding: var(--pc-pad); }
.pc-queue { right: 0; width: var(--pc-queue); border-width: 0 0 0 var(--pc-border-hvy); padding: var(--pc-pad); }
.pc-queue-card { border-top: var(--pc-border) solid var(--pc-ink); padding: 10px 0; }
.pc-queue-card h2 { margin: 0; font: var(--pc-t-tile)/1 var(--pc-display); }
.pc-queue-card p { font: 400 var(--pc-t-body)/1.35 var(--pc-text); }
.pc-queue-card div { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-queue-card--quiet { color: var(--pc-ink-3); border-color: var(--pc-rule); }
.pc-next { position: fixed; right: var(--pc-edge); bottom: var(--pc-edge); z-index: 31; max-width: calc(var(--pc-queue) - 2 * var(--pc-edge)); }
.pc-next .pc-shout { width: 100%; }

.pc-rooms { margin: 62px var(--pc-queue) 0 var(--pc-rail); min-height: calc(100vh - 62px); position: relative; }
.pc-room { min-height: calc(100vh - 62px); position: relative; }
.pc-room[hidden] { display: none; }
.pc-room--globe { overflow: hidden; }
.pc-room--globe .pc-viewport { position: absolute; inset: 0; z-index: 0; }
.pc-room--globe .pc-grid, .pc-room--globe #globe-bar { position: absolute; z-index: 2; }
/* The Globe's layout bar sits top left, compact; both edge grids start under it. */
.pc-room--globe #globe-bar { left: var(--pc-edge); top: var(--pc-edge); }
.pc-room--globe #globe-grid-left { top: calc(var(--pc-edge) + 58px); left: var(--pc-edge); width: min(32%, 410px); }
.pc-room--globe #globe-grid-right { top: calc(var(--pc-edge) + 58px); right: var(--pc-edge); width: min(32%, 410px); }
/* The camera's frame (see fleet-entry placeViewport): the open water between the edge grids. */
.pc-room--globe > .pc-stage-frame { position: absolute; z-index: 1; pointer-events: none; top: calc(var(--pc-edge) + 58px); bottom: var(--pc-edge); left: calc(var(--pc-edge) + min(32%, 410px) + var(--pc-gap)); right: var(--pc-edge); }
.pc-room--globe:not(:has(#globe-grid-left .pc-tile)) > .pc-stage-frame { left: var(--pc-edge); }
.pc-room--globe:has(#globe-grid-right .pc-tile) > .pc-stage-frame { right: calc(var(--pc-edge) + min(32%, 410px) + var(--pc-gap)); }
.pc-room--paper { background: var(--pc-paper); padding: var(--pc-edge); overflow: auto; }
.pc-room--paper .pc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pc-yard-head { border-bottom: var(--pc-border-hvy) solid var(--pc-ink); }
.pc-yard-head h1 { margin: 0 0 10px; font: var(--pc-t-room)/1 var(--pc-display); }
.pc-yard-content { display: grid; gap: var(--pc-gap); max-width: 960px; padding: var(--pc-edge) 0; }
.pc-room--bridge .pc-stage { position: relative; min-height: calc(100vh - 62px); }
.pc-room--bridge .pc-viewport { position: absolute; inset: 0; z-index: 0; }
/* The helm HUD covers the stage but only its panels take the pointer: drags on the clear water
   must reach the harbour canvas beneath (fleet.css's .pc-stage > * would otherwise catch them). */
.pc-stage > .pc-helm { pointer-events: none; }
/* Move 9: the stamp lands above the next action and stays until the next one replaces it. */
.pc-next .pc-stamp { position: absolute; right: 10px; bottom: calc(100% + 10px); padding: 5px 9px; border: var(--pc-border-hvy) solid var(--pc-ink); background: var(--pc-paper); color: var(--pc-ink); font: var(--pc-t-body)/1 var(--pc-display); letter-spacing: .14em; transform: rotate(-7deg); pointer-events: none; }

@media (max-width: 900px) {
  .pc-top { position: relative; align-items: flex-start; flex-wrap: wrap; }
  .pc-kpis { margin-left: 0; }
  .pc-rail, .pc-queue { position: relative; inset: auto; width: auto; border-width: 0 0 var(--pc-border-hvy); }
  .pc-rooms { margin: 0; }
  .pc-next { right: var(--pc-edge); bottom: var(--pc-edge); }
  .pc-room--globe #globe-grid-left, .pc-room--globe #globe-grid-right { position: relative; inset: auto; width: auto; margin: var(--pc-edge); }
  .pc-room--globe .pc-viewport { position: relative; height: 58vh; }
}

/* Setup mode (E / EDIT LAYOUT): the boards and the tile library open over the queue's column. */
[data-setup] #boards, [data-setup] #lib { display: block; position: fixed; right: 0; width: var(--pc-queue); z-index: 26; background: var(--pc-paper); border-left: var(--pc-border-hvy) solid var(--pc-ink); padding: var(--pc-pad); overflow: auto; }
[data-setup] #boards { top: 62px; height: 38vh; border-bottom: var(--pc-border-hvy) solid var(--pc-ink); }
[data-setup] #lib { top: calc(62px + 38vh); bottom: 0; }
.pc-room--globe #globe-bar .pc-layout-bar { background: var(--pc-paper); border: var(--pc-border) solid var(--pc-ink); padding: 0 8px; margin: 0; flex-wrap: nowrap; white-space: nowrap; }
[data-setup] .pc-next { display: none; }
/* The tile's card covers the room between the rail and the queue, top bar to the bottom. */
.pc-card { inset: 62px var(--pc-queue) 0 var(--pc-rail); border: var(--pc-border-hvy) solid var(--pc-ink); padding: var(--pc-pad); }
.pc-card > .pc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pc-room--globe .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- Tiles inside the shell ------------------------------------------------------------
   fleet.css loads before this file and still styles the old panels' buttons and cards, so
   the tile rules that must win are here. */
.pc-btn.pc-btn--ink { background: var(--pc-ink); color: var(--pc-paper); border-color: var(--pc-ink); font: 700 var(--pc-t-body)/1 var(--pc-text); letter-spacing: 0; text-transform: none; }
.pc-btn.pc-btn--ink:hover:not(:disabled) { background: var(--pc-ink-2); border-color: var(--pc-ink-2); color: var(--pc-paper); }
/* Some tiles wrap their own body; only the dashboard's outer body sizes and scrolls. */
.pc-tile-body .pc-tile-body { height: auto; overflow: visible; }
.pc-tile .pc-backroom { margin-top: 0; padding-top: 0; border-top: 0; }
.pc-tile .pc-offers { gap: 6px; }
.pc-tile .pc-offer { padding: 8px 10px; gap: 4px; }
.pc-tile .pc-offer-meta { gap: 2px 14px; font: 500 var(--pc-t-micro)/1.4 var(--pc-mono); }
.pc-tile .pc-offer-foot { gap: 6px 12px; }
.pc-tile .pc-offer-foot .pc-btn { margin-left: auto; }
/* The hull tile: the columns take what the head and the actions leave, and clip; the card
   (the tile's title) shows everything. */
.pc-tile .pc-hull-cols { flex: 1 1 0; overflow: hidden; }
.pc-tile .pc-col { overflow: hidden; }
.pc-refits li { grid-template-columns: minmax(0, 1fr) auto; }
.pc-refits li > .pc-refit-name { grid-column: 1; }
.pc-refits li > .pc-refit-cost { grid-column: 1; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.pc-refits li > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
/* A narrow pipeline names only the current stage; the dots carry the rest. */
.pc-pipe { container-type: inline-size; }
@container (max-width: 330px) {
  .pc-pipe-step:not(.is-on) .pc-pipe-name { visibility: hidden; }
  .pc-pipe-step.is-on .pc-pipe-name { overflow: visible; }
  .pc-pipe-step.is-on:nth-last-child(-n+2) .pc-pipe-name { direction: rtl; text-align: right; }
}
/* The rail row: name, then status on its own line. */
.pc-rail .pc-vcard-row { flex-direction: column; align-items: flex-start; gap: 3px; }
.pc-rail .pc-status { text-align: left; }

/* ---- Narrow: one column, the globe first ------------------------------------------------ */
@media (max-width: 900px) {
  .pc-app { padding-bottom: 84px; }
  .pc-top { height: auto; min-height: 0; padding: 0 0 8px; gap: 8px 12px; }
  .pc-top > .pc-brand { align-self: auto; min-height: 48px; }
  .pc-top > .pc-room-nav, .pc-top > .pc-kpis, .pc-top > .pc-top-actions { padding: 0 var(--pc-edge); }
  .pc-top-actions { flex-wrap: wrap; }
  .pc-top-actions .pc-account-trigger { max-width: 100%; }
  .pc-room--globe { display: flex; flex-direction: column; }
  .pc-room--globe .pc-viewport { order: 0; }
  .pc-room--globe #globe-bar { position: relative; inset: auto; order: 1; margin: var(--pc-edge) var(--pc-edge) 0; }
  .pc-room--globe #globe-grid-left { order: 2; }
  .pc-room--globe #globe-grid-right { order: 3; }
  .pc-room--globe > .pc-stage-frame { display: none; }
  .pc-next { left: var(--pc-edge); max-width: none; }
}

/* ---- Middle widths: one row of furniture -------------------------------------------------- */
.pc-kpis * { white-space: nowrap; }
.pc-sr, #btn-motion > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 1441px) { #btn-motion > span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; } }
@media (max-width: 1440px) and (min-width: 901px) {
  .pc-top { gap: 10px; }
  .pc-brand { padding: 0 12px; }
  .pc-brand-text strong { font-size: 17px; }
  .pc-room-nav { flex-wrap: nowrap; }
  .pc-room-nav button { padding: 0 8px; }
  .pc-kpis { gap: 12px; }
  .pc-top-actions .pc-account-trigger { max-width: 150px; }
  .pc-top-actions .pc-btn { padding: 0 9px; white-space: nowrap; }
}
@media (max-width: 520px) {
  #btn-motion > span { display: inline; }
  .pc-top-actions .pc-account-trigger span { display: inline; }
}
.pc-weather { row-gap: 5px; align-items: baseline; }
/* A timed operation's progress in the rail row; updateGameTick moves it each second. */
.pc-rail .pc-vprogress { display: grid; gap: 3px; background: linear-gradient(var(--pc-rule), var(--pc-rule)) top / 100% 4px no-repeat; }
.pc-rail .pc-vprogress b { display: block; height: 4px; background: var(--pc-ink); }
.pc-rail .pc-vprogress span { font: 500 var(--pc-t-eyebrow)/1.2 var(--pc-mono); letter-spacing: .08em; color: var(--pc-ink-2); }

/* ---- Leftovers of the old sheet, restated in the new tokens ---------------------------- */
.pc-btn--outline { border-color: var(--pc-ink); }            /* was --pc-data, which is data only */
.pc-chip--blocked { color: var(--pc-alert); border-color: var(--pc-alert); }
.pc-goal--locked { border-style: dashed; }
.pc-goal--locked b, .pc-goal--locked small { color: var(--pc-ink-3); }
.pc-helm-result-text { font-size: 12.5px; margin: 0; }       /* over the canvas: the HUD's own colours */
/* No WebGL: the Globe room says so in the open water, above the edge grids' level. */
.pc-room--globe > .pc-stage-fallback { position: absolute; z-index: 3; top: calc(var(--pc-edge) + 58px); left: calc(var(--pc-edge) + min(32%, 410px) + var(--pc-gap)); right: var(--pc-edge); margin: 0; padding: var(--pc-pad); background: var(--pc-paper); border: var(--pc-border) solid var(--pc-ink); font: 400 var(--pc-t-body)/1.4 var(--pc-text); }
@media (max-width: 900px) { .pc-room--globe > .pc-stage-fallback { position: relative; inset: auto; order: 0; margin: var(--pc-edge); } }
/* The cash figure's notes (debt, reputation) share one line, so the block fits the 62 px bar. */
.pc-kpi { gap: 1px; }
.pc-kpis > .pc-kpi:first-child { grid-template-columns: auto auto; justify-content: start; column-gap: 10px; }
.pc-kpis > .pc-kpi:first-child > .pc-eyebrow, .pc-kpis > .pc-kpi:first-child > .pc-kpi-value { grid-column: 1 / -1; }
.pc-kpi-debt, .pc-kpi-rep { font-size: 10px; line-height: 1.1; }
/* The sea bulletin in a two-column tile: fixed columns, wrapped words, the text size of a tile. */
.pc-tile .pc-bulletin { table-layout: fixed; font: 500 var(--pc-t-micro)/1.25 var(--pc-mono); }
.pc-tile .pc-bulletin th, .pc-tile .pc-bulletin td { padding: 3px; overflow-wrap: break-word; }
.pc-tile .pc-bulletin tr > :first-child { width: 34%; }
/* Reduced motion, as on master: no CSS transition or animation anywhere (motion.js drives its own
   moves at 1 ms). The in-game switch wins over the OS in both directions (docs/sjofart/03-motion.md). */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='full']) *, :root:not([data-motion='full']) *::before, :root:not([data-motion='full']) *::after { animation: none !important; transition: none !important; }
}
[data-motion='reduced'] *, [data-motion='reduced'] *::before, [data-motion='reduced'] *::after { animation: none !important; transition: none !important; }
/* The Bridge stage: the title (company name included) keeps its width, the tools sit under it. */
.pc-room--bridge .pc-stage-head { align-self: flex-start; max-width: 100%; }
.pc-room--bridge .pc-stage-tools { position: static; align-self: flex-start; flex-wrap: wrap; border-top: 0; }
/* Desktop: the page never scrolls (fleet.css), so a paper room scrolls inside the viewport —
   the Yard's orders, maintenance and liner forms run well below the fold. */
@media (min-width: 901px) {
  .pc-room--paper { height: calc(100vh - 62px); min-height: 0; overflow: auto; overscroll-behavior: contain; }
}
/* Phones: a card takes the whole screen (the desktop inset above clears the rail and queue). */
@media (max-width: 900px) { .pc-card { inset: 0; z-index: 70; } }
/* --pc-data is for data, never a border (docs/sjofart/RULES.md): the old sheet's accents, in ink. */
.pc-vcard:hover, .pc-vcard[aria-pressed="true"], .pc-offer:hover, .pc-offer.is-signed { border-color: var(--pc-ink); background: var(--pc-ground); }
.pc-next, .pc-next-goal { border-left-color: var(--pc-ink); background: var(--pc-paper); }
.pc-card--weather, .pc-goal--open { border-left-color: var(--pc-ink); }
