/* Sailing history log — sits at the very bottom of the report, below the chronological
   index. Reuses the report's own custom properties (with literal fallbacks in case this
   stylesheet is ever loaded before/without report.css) rather than a new palette. */

.sailing-log-section {
  margin-top: 28px;
  padding-top: 7px;
  border-top: 1px solid #ccd6df;
  font-family: Arial, Helvetica, sans-serif;
}

.log-empty-state {
  margin: 0;
  padding: 20px;
  background: #f5f7f8;
  color: var(--muted, #5c6c7c);
  font-size: 0.78rem;
  text-align: center;
}

/* One native <details> per monitored sailing. Thin borders, no rounded cards, no shadow —
   matches the dense printed-spreadsheet language used by the sibling sections. */
.sailing-log-item {
  margin-bottom: 6px;
  border: 1px solid var(--grid, #c6d0db);
  background: #fff;
}

.sailing-log-item:last-of-type { margin-bottom: 0; }

/* Row number / ship / dates / port on one compact line, plus a record-count badge.
   No nested interactive elements — the <details>/<summary> pair is the only control. */
.sailing-log-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px 6px 12px;
  border-left: 4px solid var(--ship-row, #c6d0db);
  background: #fff;
  color: var(--ink, #1f2937);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.sailing-log-summary:hover {
  background: var(--header-fill, #eef2f6);
}

/* Matches the same outline treatment already used for .table-scroll:focus-visible
   elsewhere in the report, so keyboard focus reads consistently across the page. */
.sailing-log-summary:focus-visible {
  outline: 3px solid #1d6fb8;
  outline-offset: 2px;
}

.log-summary-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-count-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(19, 59, 109, 0.12);
  color: var(--navy, #133b6d);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* The opened body stays white/neutral — only the summary carries the ship accent. */
.sailing-log-body {
  padding: 6px 8px 8px;
  background: #fff;
  border-top: 1px solid var(--grid, #c6d0db);
}

.log-no-entries {
  margin: 0;
  padding: 8px 10px;
  background: #f8fafb;
  color: var(--muted, #5c6c7c);
  font-size: 0.72rem;
}

.sailing-log-table {
  width: 100%;
  border: 1px solid var(--grid, #c6d0db);
  font-size: 0.78rem;
}

.sailing-log-table thead th {
  padding: 4px 6px;
  background: var(--header-fill, #eef2f6);
  color: var(--navy, #133b6d);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
}

.sailing-log-table tbody td {
  padding: 3px 6px;
  color: var(--ink, #1f2937);
}

.log-time-cell {
  white-space: nowrap;
  color: var(--ink-soft, #5b6470);
  border-left: 3px solid transparent;
}

.log-source-cell,
.log-status-cell { white-space: nowrap; }

.log-price-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Public vs Mine are two different data sources — Mine gets a left accent stripe plus a
   faint tint so the two are distinguishable at a glance without relying on the text alone. */
.sailing-log-table tbody tr.log-source-mine {
  background: rgba(22, 163, 74, 0.06);
}

.sailing-log-table tbody tr.log-source-mine .log-time-cell {
  border-left: 3px solid var(--my-rate, #16a34a);
}

.sailing-log-table tbody tr.log-source-public .log-time-cell {
  border-left: 3px solid transparent;
}

/* Sold out reads muted/gray; available reads with a little positive color, nothing loud. */
.sailing-log-table tbody tr.log-status-sold-out .log-status-cell,
.sailing-log-table tbody tr.log-status-sold-out .log-price-cell {
  color: var(--ink-soft, #5b6470);
}

.sailing-log-table tbody tr.log-status-available .log-status-cell {
  color: var(--my-rate, #16a34a);
  font-weight: 700;
}

@media (max-width: 760px) {
  .sailing-log-summary { flex-wrap: wrap; }
  .log-count-badge { order: 2; }
}
