/* Berth guidance card (public/js/berthguide.js, V5-PLAN item 2). #berthLine gets class `bg` while it guides to a berth:
   the plain text line steps aside for a mini harbour plan, the big distance, the course to steer, depth and advice.
   Loaded after style.css, so equal-specificity rules here win. */
#berthLine .bgCard { display: none; }
#berthLine.bg { display: grid; grid-template-columns: 116px minmax(0, 1fr); column-gap: var(--s3); row-gap: 6px; align-items: center; border-left: 3px solid var(--green); }
#berthLine.bg .berthInfo { display: none; }
#berthLine.bg .bgCard { display: contents; }
#berthLine.bg .bgPlan { grid-row: 1 / span 2; grid-column: 1; width: 116px; height: 116px; border-radius: var(--r1); border: 1px solid var(--line-2); background: #0d2a40; display: block; }
#berthLine.bg .bgMain { grid-column: 2; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#berthLine.bg .berthBtns { grid-column: 2; justify-self: start; }
.bgHead { display: flex; align-items: center; gap: var(--s2); min-width: 0; font-size: 13px; font-weight: 650; color: #8dffc0; }
.bgName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgChip { flex: none; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; color: var(--accent-ink); background: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.bgBig { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.bgDist { font-family: var(--mono); font-size: 30px; line-height: 1.05; font-weight: 700; color: #fff; white-space: nowrap; letter-spacing: -0.02em; }
.bgSteer { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--accent-2); white-space: nowrap; overflow: hidden; }
.bgSteerTxt { overflow: hidden; text-overflow: ellipsis; }
.bgArrow { display: inline-flex; width: 28px; height: 28px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 211, 74, 0.16); color: #ffd34a; transition: transform 250ms ease; }
.bgArrow.ok { background: var(--green-soft); color: var(--green); }
.bgArrow .ic { width: 20px; height: 20px; }
.bgFacts { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgFacts.bad { color: var(--red); font-weight: 600; }
.bgAdvice { font-size: 12.5px; font-weight: 600; color: var(--fg); line-height: 1.3; }
.bgAdvice.warn { color: var(--accent); }
.bgAdvice.good { color: var(--green); }
.bgAdvice.bad { color: var(--red); }

/* phones: the card sits at the top (style.css) and must stay compact — small plan, one line each */
body.touch #berthLine.bg { grid-template-columns: 62px minmax(0, 1fr); column-gap: var(--s2); row-gap: 4px; padding: 6px 8px; }
body.touch #berthLine.bg .bgPlan { grid-row: 1; width: 62px; height: 62px; }
body.touch #berthLine.bg .berthBtns { grid-column: 1 / -1; justify-self: stretch; }
body.touch .bgHead { font-size: 12px; }
body.touch .bgDist { font-size: 22px; }
body.touch .bgSteer { font-size: 12.5px; }
body.touch .bgArrow { width: 24px; height: 24px; }
body.touch .bgFacts { display: none; }
body.touch .bgAdvice { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* berthOn log handled by drawer & pill */

@media (orientation: landscape) and (max-height: 520px) {
  body.touch #berthLine.bg { grid-template-columns: 54px minmax(0, 1fr) auto; }
  body.touch #berthLine.bg .bgPlan { width: 54px; height: 54px; }
  body.touch #berthLine.bg .berthBtns { grid-column: 3; grid-row: 1; }
  
}
