/* The Boats view. Dense on purpose: staff scan a hundred boats here, so each is two short lines and
   the only decoration is the operator's colour. Every colour comes from the theme's tokens except
   that one, which belongs to the operator. */
:root .boats-view { overflow: hidden; background: var(--canvas); }
:root .boats-view * { box-sizing: border-box; font-family: var(--ui-font); }
:root .boats-content {
  display: flex; flex-direction: column; height: 100%; min-height: 0; max-width: 1180px; margin: 0 auto;
  padding: 8px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}
:root .boats-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-bottom: 6px; }
:root .boats-search {
  flex: 1 1 220px; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--control-radius);
  background: var(--card); color: var(--ink);
  /* Never under 16px: Safari zooms the page when a smaller field takes focus. Grows with the reader's text size. */
  font-size: max(16px, 1rem);
}
:root .boats-recent, :root .boats-operator {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--control-radius); background: var(--card); color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer;
}
:root .boats-recent[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--card); }
:root .boats-operators { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 100%; }
:root .boats-operator { min-height: 32px; padding: 0 8px; }
:root .boats-operator[aria-pressed="true"] { color: var(--ink); border-color: var(--control-border, var(--line)); }
:root .boats-operator[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
:root .boats-operator-count { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
:root .boats-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--operator-color, var(--muted)); }
:root .boats-message { margin: 0 0 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--card); color: var(--ink); font-size: 12px; }
:root .boats-list {
  flex: 1; min-height: 0; margin: 0; padding: 0 0 max(12px, env(safe-area-inset-bottom)); list-style: none; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
:root .boats-group {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 6px 4px 3px;
  background: var(--canvas); color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
:root .boats-group-count { margin-left: auto; font-variant-numeric: tabular-nums; }
:root .boats-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); background: var(--card);
}
:root .boats-row.is-quiet .boats-main { opacity: .62; }
:root .boats-main {
  grid-column: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px;
  align-items: center; width: 100%; min-height: 44px; padding: 5px 8px; border: 0; background: transparent; color: var(--ink);
  font-size: 13px; text-align: left; cursor: pointer;
}
:root .boats-main:active, :root .boats-more:active { background: var(--sunken); }
:root .boats-chip {
  grid-row: 1 / 3; min-width: 38px; padding: 3px 4px; border-radius: 4px; background: var(--operator-color, var(--muted));
  color: #fff; font-size: 10px; font-weight: 900; text-align: center; letter-spacing: .02em;
  text-shadow: 0 0 2px rgb(0 0 0 / .45);
}
:root .boats-chip.has-operator-mark {
  display: flex; align-items: center; justify-content: center; align-self: center; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line); text-shadow: none;
}
:root .boats-chip .operator-mark { display: block; width: 1.3em; height: 1.3em; object-fit: contain; }
:root .boats-name { min-width: 0; overflow: hidden; color: var(--navy); font-weight: 900; white-space: nowrap; text-overflow: ellipsis; }
:root .boats-number { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
:root .boats-name .vehicles-only { margin-right: 4px; color: var(--navy); }
:root .boats-ago { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
:root .boats-where {
  grid-column: 2 / 4; min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis;
}
:root .boats-state { font-style: italic; }
:root .boats-more {
  grid-column: 2; width: 44px; min-height: 44px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted);
  font: italic 900 15px/1 Georgia, serif; cursor: pointer;
}
:root .boats-empty { padding: 16px 8px; color: var(--muted); font-size: 13px; }
:root .boats-footer { margin: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
:root .boats-credit { flex: 0 0 auto; margin: -2px 0 4px; padding: 0; }
:root :is(.boats-main, .boats-more, .boats-recent, .boats-operator, .boats-search):focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
/* A phone keeps the operator chips to one row that scrolls sideways inside itself, so the list starts
   a third of the way up the screen instead of two thirds. */
@media (max-width: 700px) {
  :root .boats-operators { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  :root .boats-operators::-webkit-scrollbar { display: none; }
  :root .boats-operator { flex: 0 0 auto; }
}
/* Wide enough for two columns of rows; groups stay full width. */
@media (min-width: 900px) {
  :root .boats-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; column-gap: 12px; }
  :root .boats-group, :root .boats-empty { grid-column: 1 / -1; }
}
:root.ride-minimized .boats-view { --app-safe-bottom: 0px; }
