/* The port card (client/src/ui/portcard.ts; owner, 2026-10-30): the kit's sheet, docked to the right on a screen on
   its side — the sea still in sight on the left — a bottom sheet on one standing up. Square corners, the window's frame. */

.k-sheet-root:has(> .pcd-sheet) { justify-content: flex-end; }
.k-sheet.pcd-sheet { width: min(560px, 100%); max-height: 92dvh; text-align: left; }
@media (orientation: landscape) {
  .k-sheet-root:has(> .pcd-sheet) { align-items: stretch; }
  .k-sheet.pcd-sheet {
    width: clamp(380px, 54vw, 500px); height: auto; max-height: none; margin: max(6px, var(--sa-t, 0px)) max(6px, var(--sa-r, 0px)) 6px 0;
    border-radius: 0; border-bottom: 1px solid var(--k-brass-dim); transform: translateX(105%);
    padding-right: var(--k-sp-3); padding-bottom: var(--k-sp-2);
  }
  .k-sheet-root.k-open .k-sheet.pcd-sheet { transform: none; }
  .k-sheet-root.k-closing .k-sheet.pcd-sheet { transform: translateX(105%); }
  .pcd-sheet .k-sheet-grip { display: none; }
  .skinned .k-sheet.pcd-sheet.panel { border-width: 12px; border-image-width: 12px; }
}
@media (orientation: landscape) and (min-height: 600px) {
  .k-sheet.pcd-sheet { width: 460px; margin: 12px 12px 12px 0; }
}
.pcd-sheet .k-sheet-head { min-height: 44px; }
.pcd-sheet .k-sheet-title { color: var(--k-gold, #e0b862); }
.pcd-sheet .k-sheet-body { padding-right: 2px; font-size: 14px; line-height: 1.35; }
.pcd-sheet .k-sheet-foot { padding-top: 8px; }
.pcd-sheet .k-sheet-foot > .pcd-go { flex: 1 1 auto; max-width: none; min-height: 48px; gap: 8px; letter-spacing: 0.04em; }

.pcd-head { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.pcd-head .pcd-crest { width: 40px; height: 40px; flex: none; object-fit: contain; }
.pcd-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pcd-sub { color: var(--k-bone); opacity: 0.85; font-size: 13px; }
.pcd-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pcd-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid var(--k-brass-dim); font-size: 12px; letter-spacing: 0.02em; background: rgba(0, 0, 0, 0.25); }
.pcd-chip.safe { color: #9fd58e; border-color: rgba(120, 180, 100, 0.55); }
.pcd-chip.contested { color: #e6c46c; border-color: rgba(214, 170, 80, 0.55); }
.pcd-chip.lawless { color: #ec9a86; border-color: rgba(206, 110, 90, 0.6); }

.pcd-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 8px; font-size: 13px; color: var(--k-bone); }
.pcd-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.pcd-meta .ico-sm { width: 16px; height: 16px; }
.pcd-clock { color: var(--k-gold, #e0b862); }

.pcd-sec { margin: 0 0 10px; }
.pcd-sec > h3 { margin: 0 0 4px; padding: 0 0 3px; border-bottom: 1px solid rgba(176, 141, 87, 0.35); font: 400 16px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: 0.05em; color: var(--k-gold, #e0b862); }
.pcd-src { margin: 2px 0 4px; font-size: 13px; color: var(--k-bone); }
.pcd-src.warn { color: #e6c46c; }
.pcd-note { margin: 0 0 4px; font-size: 12px; }

.pcd-grp { margin: 0 0 6px; }
.pcd-grp > h4 { margin: 6px 0 2px; font: 600 12px/1.3 var(--k-font-sans, Inter, sans-serif); letter-spacing: 0.06em; text-transform: uppercase; color: var(--k-brass, #b08d57); }
.pcd-food { padding: 2px 6px 4px; margin: 0 -6px 8px; border-left: 2px solid rgba(224, 184, 98, 0.65); background: rgba(224, 184, 98, 0.06); }
.pcd-food > h4 { color: var(--k-gold, #e0b862); }

.pcd-row { display: grid; grid-template-columns: minmax(0, 1fr) 62px 62px 44px 48px; align-items: center; column-gap: 4px; min-height: 34px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.pcd-row > .ico-md, .pcd-row > img { width: 26px; height: 26px; }
.pcd-row:not(.pcd-th) { grid-template-columns: 28px minmax(0, 1fr) 62px 62px 44px 48px; }
.pcd-row.pcd-row--lv { grid-template-columns: 28px minmax(0, 1fr) auto; }
.pcd-th { min-height: 20px; font-size: 11px; color: var(--k-brass, #b08d57); border-bottom: 0; grid-template-columns: minmax(0, 1fr) 62px 62px 44px 48px; padding-left: 32px; }
.pcd-gn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--k-bone); }
.pcd-gn small { font-size: 10px; }
.pcd-n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcd-n .money { justify-content: flex-end; }
.pcd-st { color: var(--k-bone); opacity: 0.75; font-size: 12px; }
.pcd-tr { font-style: normal; font-size: 11px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pcd-tr.up { color: #ec9a86; }
.pcd-tr.down { color: #9fd58e; }
.pcd-lv { justify-self: end; padding: 1px 8px; border: 1px solid var(--k-brass-dim); font-size: 12px; color: var(--k-bone); }
.pcd-lv.cheap { color: #9fd58e; border-color: rgba(120, 180, 100, 0.5); }
.pcd-lv.dear { color: #ec9a86; border-color: rgba(206, 110, 90, 0.5); }

.pcd-svcs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pcd-svc { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px; border: 1px solid rgba(176, 141, 87, 0.3); background: rgba(0, 0, 0, 0.22); }
.pcd-svc .ico-md { width: 30px; height: 30px; flex: none; }
.pcd-svc > span { display: flex; flex-direction: column; min-width: 0; }
.pcd-svc b { font-weight: 600; font-size: 13px; color: var(--k-bone); }
.pcd-svc small { font-size: 11.5px; line-height: 1.25; color: var(--k-bone); opacity: 0.75; overflow-wrap: anywhere; }
.pcd-svc.off { opacity: 0.5; }

.pcd-ev p { margin: 2px 0; color: #ec9a86; font-size: 13px; }
.pcd-wh { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.pcd-wh > span { display: inline-flex; align-items: center; gap: 4px; }

/* levels only (no exact prices): two goods a line */
.pcd-lvgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
.pcd-lvgrid .pcd-row--lv { grid-template-columns: 26px minmax(0, 1fr) auto; min-height: 32px; }
.pcd-lvgrid .pcd-row--lv > .ico-md { width: 22px; height: 22px; }
.pcd-lvgrid .pcd-gn { font-size: 13px; }
.pcd-lvgrid .pcd-lv { padding: 0 5px; font-size: 11px; }

/* a phone on its side (360–481 px tall): the head in one line, the market gets the height */
@media (max-height: 520px) {
  .pcd-sheet .k-sheet-head { min-height: 34px; }
  .pcd-sheet .k-sheet-title { font-size: 17px; }
  .pcd-head { gap: 8px; margin: 0 0 3px; }
  .pcd-head .pcd-crest { width: 28px; height: 28px; }
  .pcd-id { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 8px; }
  .pcd-sub { font-size: 12px; }
  .pcd-chip { min-height: 20px; font-size: 11px; padding: 0 6px; }
  .pcd-meta { margin: 0 0 4px; font-size: 12px; }
  .pcd-sec { margin: 0 0 6px; }
  .pcd-sec > h3 { font-size: 14px; margin: 0 0 2px; padding: 0 0 2px; }
  .pcd-src { margin: 1px 0 2px; font-size: 12px; }
  .pcd-note { font-size: 11px; }
  .pcd-grp > h4 { margin: 4px 0 1px; font-size: 11px; }
  .pcd-row { min-height: 30px; }
  .pcd-svc { min-height: 44px; }
  .pcd-sheet .k-sheet-foot { padding-top: 6px; }
  .pcd-sheet .k-sheet-foot > .pcd-go { min-height: 44px; }
}

@media (max-width: 420px) {
  .pcd-row:not(.pcd-th) { grid-template-columns: 24px minmax(0, 1fr) 56px 56px 38px 40px; }
  .pcd-th { grid-template-columns: minmax(0, 1fr) 56px 56px 38px 40px; padding-left: 28px; }
}

/* the port window's market: the time till the prices change */
.mk-clock { display: flex; align-items: center; gap: 5px; margin: 2px 0 6px; font-size: 13px; }
.mk-clock .ico-sm { width: 16px; height: 16px; }
.pcd-lv.none { border-color: transparent; opacity: 0.45; }

/* «Переход» between hub ports (owner, 2026-10-30; client/src/ui/ferry.ts): the harbour's page and the card's section. */
.fy-text { margin: 0 0 6px; font-size: 13px; }
.fy-st { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; }
.fy-list { display: flex; flex-direction: column; }
.fy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 48px; padding: 4px 0; border-bottom: 1px solid rgba(224, 184, 98, 0.16); }
.fy-row:last-child { border-bottom: 0; }
.fy-to { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.fy-to b { white-space: nowrap; }
.fy-to small { color: var(--k-bone, #cfc3a3); opacity: 0.75; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fy-km { font-variant-numeric: tabular-nums; opacity: 0.85; white-space: nowrap; font-size: 13px; }
.fy-row--locked { opacity: 0.6; filter: grayscale(0.85); }
.fy-row--locked small { opacity: 1; font-style: italic; }
/* forum, Эдуард, post 71: a hub whose harbour is closed to her — the reason in red, whole (it wraps), no passage */
.fy-row--closed { background: rgba(160, 40, 30, 0.12); }
.fy-row--closed .fy-to small.fy-closed { color: var(--bad, #e2675a); opacity: 1; white-space: normal; flex-basis: 100%; display: flex; gap: 4px; align-items: flex-start; line-height: 1.25; }
.fy-row .fy-go { min-height: 44px; min-width: 128px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fy-price { white-space: nowrap; }
.fy--compact .fy-row { min-height: 40px; }
.fy-was { display: block; font-size: 11px; opacity: 0.6; text-align: right; }
.fy-was, .fy-was * { text-decoration: line-through; }
.fy-quest { font-style: normal; color: #9fd37a; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.fy-row--quest .fy-go { box-shadow: 0 0 0 1px rgba(159, 211, 122, 0.55) inset; }
.fy-pirate { margin-top: 0; }
.pcd-ferry h3 { display: flex; align-items: center; gap: 6px; }
