/* Printing the trip on paper (owner, 2026-10-15). Loaded with media="print".
   Plan view: one traveller per page, each row with its day in a left gutter ("24" over
   "Dec"), clear lines between the cards, no card split across pages. Left out: the page
   header (account, sign out), the top bar (title, travellers, switches), buttons, links,
   drag handles and drop zones. */

@page { margin: 12mm 12mm 14mm; }

html, body { background: #fff !important; }
body { color: #000; font-size: 11pt; }
* { box-shadow: none !important; }
/* Traveller and type colours print as on screen. */
.person-tag, .type-icon, .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ---------- left out ---------- */
#app-header, .topbar, .notices, .hint, #live, dialog,
.plan-gap, .plan-reset, .resizer, .handle, .move-buttons, .add-card,
.card-actions, .card-link, .more, .detail-link, [data-action] { display: none !important; }

/* ---------- Plan view ---------- */
.board, .board.plan-view { display: block !important; padding: 0 !important; overflow: visible !important; background: #fff; }
.plan-col {
  display: block !important; width: auto !important; max-width: none !important; min-width: 0 !important;
  border: 0 !important; background: none !important; padding: 0 !important; margin: 0;
}
/* Each traveller starts on a new page. */
.plan-col + .plan-col { break-before: page; }
.plan-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 0 0 6pt !important; margin-bottom: 4pt; border-bottom: 2px solid #000 !important; background: none !important;
}
.plan-head .person-tag { font-size: 13pt; line-height: 1.5; padding: 0 10px; }
.plan-head .trip-span { color: #333; font-size: 10pt; }
.plan-head .section-total strong { font-size: 14pt; }
/* The total only: the traveller's tag on the left already says whose it is. */
.plan-head .price-basis { display: none; }
.type-filter { display: none !important; }
.plan-cards { display: block !important; padding: 0 !important; overflow: visible !important; }

/* A row: the day in the gutter, the row's cards to the right; a line under every row, so
   the last row on a page is closed too. */
.plan-row {
  display: flex !important; align-items: stretch; gap: 0 !important;
  padding: 5pt 0; break-inside: avoid; page-break-inside: avoid;
  /* A grey dashed line under the row, with long dashes (a border's dashes are short). */
  background: repeating-linear-gradient(to right, #aaa 0 7px, transparent 7px 12px) bottom left / 100% 1px no-repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* Day number big in the gutter, the month under it (absolutely placed, so it is not a
   flex item next to the cards). */
.plan-row { position: relative; }
.plan-row::before {
  content: attr(data-day); flex: 0 0 15mm; padding: 5pt 6pt 0 0; text-align: center;
  font-size: 18pt; font-weight: 700; line-height: 1.1; color: #000;
}
.plan-row::after {
  content: attr(data-month); position: absolute; left: 0; top: 33pt; width: calc(15mm - 6pt);
  text-align: center; font-size: 9pt; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #444;
}
/* Cards side by side share the row's width, each a framed card with room around it. */
.plan-cell {
  flex: 1 1 0 !important; min-width: 0 !important; width: auto !important;
  display: flex !important; flex-direction: column; gap: 5pt; padding: 0 3pt !important;
}
/* Cards in a row are equally tall (owner, 2026-10-15). */
.plan-item { break-inside: avoid; page-break-inside: avoid; flex: 1 0 auto; display: flex; }
.plan-item > .card { flex: 1; }

/* ---------- cards ---------- */
/* A thin grey frame; the left edge keeps the card type's colour, as on screen. */
.card {
  border-top: 1px solid #aaa !important; border-right: 1px solid #aaa !important; border-bottom: 1px solid #aaa !important;
  border-left-width: 4px !important; border-left-style: solid !important;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  border-radius: 6pt !important; background: #fff !important;
  padding: 6pt 8pt !important; break-inside: avoid; page-break-inside: avoid;
}
/* No prices on paper: route or name, times and what is included. */
.card-price, .price-note { display: none !important; }
/* A card on its row's one day leaves out that date (the gutter shows it); the times are
   larger. A card over several days keeps both dates. Dates print without the year. */
.on-row-day .when-start { display: none; }
/* Times under the name, not in a right-hand column. */
.card-top { flex-direction: column !important; gap: 2pt !important; }
.card-meta { align-items: flex-start !important; text-align: left !important; padding-top: 0 !important; }
.card-when { white-space: normal !important; }
.card-when .when-time { font-size: 12pt; font-weight: 650; color: #000; }
.card-when .when-sep { font-size: 11pt; }
/* Start and end line up: each line's parts sit in a row, the arrow before the end date
   has a fixed width, and a start line above it is indented by the same amount. */
.card-when > div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.3em; }
/* Dates print without the year. */
.card-when .part-year { display: none; }
/* Over several days: arrow, weekday, day, month and time in columns, so the day numbers
   and the times stand under each other ("   Fri 25 Dec  17:00" / "→  Wed 30 Dec  15:30"). */
.card-when:has(> div > .when-sep:first-child) {
  display: grid !important; grid-template-columns: 1.1em auto auto auto auto; justify-content: start;
  column-gap: 0.35em; align-items: baseline;
}
.card-when:has(> div > .when-sep:first-child) > div,
.card-when:has(> div > .when-sep:first-child) :is(.when-start, .when-date) { display: contents; }
.card-when:has(> div > .when-sep:first-child) .part-literal { display: none; }
.card-when:has(> div > .when-sep:first-child) .when-sep:first-child { grid-column: 1; }
.card-when:has(> div > .when-sep:first-child) .part-weekday { grid-column: 2; }
.card-when:has(> div > .when-sep:first-child) .part-day { grid-column: 3; justify-self: end; font-variant-numeric: tabular-nums; }
.card-when:has(> div > .when-sep:first-child) .part-month { grid-column: 4; }
.card-when:has(> div > .when-sep:first-child) .when-time { grid-column: 5; padding-left: 0.3em; }
/* "Everyone" for a card for all travellers, level with the people tags of others. */
.card-head[data-everyone]::after {
  content: attr(data-everyone); align-self: flex-start; margin: 3px 0 0 32px; padding: 0 7px;
  border-radius: 999px; border: 1px solid #999; font-size: 11px; font-weight: 650; line-height: 16px; color: #333;
}
/* On paper narrow cards keep their second line (place, airline) and their chips; the chips
   stack when there is no room side by side. */
.card .card-head > .card-sub { display: block !important; }
.card .chips { display: flex !important; }
/* Only what is included (green): not included and unknown are for planning, not paper. */
.chip:not(.yes) { display: none !important; }
.chips:not(:has(.chip.yes)) { display: none !important; }
@container card (max-width: 270px) {
  .card .card-head > .card-sub { margin-left: 26px; }
  .card-head[data-everyone]::after { margin-left: 0; font-size: 9.5px; line-height: 15px; padding: 0 5px; }
}
/* Lower, smaller chips, so they take less height. */
.chips { gap: 3pt !important; margin: 1pt 0 !important; }
.chip { font-size: 8.5pt !important; line-height: 13pt !important; padding: 0 5pt 0 4pt !important; gap: 3pt !important; }
.chip-icon { font-size: 9pt !important; }
.card.excluded { opacity: 0.55; }
.card-title { font-size: 11.5pt; }
.card-sub, .card-when, .card-facts { color: #333 !important; }
/* Notes in full: no clamping, no "Show more". */
.card-desc, .card-desc.clamped {
  display: block !important; -webkit-line-clamp: none !important; max-height: none !important; overflow: visible !important;
  color: #222; font-size: 9.5pt; border-top: 0; padding-top: 2pt; margin-top: 2pt;
}

/* ---------- Options view (when printed from there) ---------- */
.section { break-inside: auto; border: 1px solid #888 !important; background: none !important; }
.section-summary { border-bottom: 1px solid #888 !important; }
.cards { background: none !important; }
.cell .card + .card, .cell > * + * { border-top: 1px dashed #bbb !important; }

/* ---------- level lines across a row (owner, 2026-10-15) ----------
   Cards side by side share their line heights with CSS subgrid: name, second line, people,
   times, facts (nights, stops), chips and notes each start at the same height in every card
   of the row, so the row reads across. A cell with cards stacked in it keeps its column. */
.plan-row {
  display: grid !important; grid-template-columns: 15mm; grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column; grid-template-rows: repeat(7, auto); column-gap: 6pt; row-gap: 0;
}
.plan-row::before { grid-column: 1; grid-row: 1 / -1; }
.plan-cell:not(:has(> .plan-item + .plan-item)) {
  grid-row: 1 / -1; display: grid !important; grid-template-rows: subgrid; row-gap: 0; padding: 0 !important;
}
.plan-cell:not(:has(> .plan-item + .plan-item)) > .plan-item { grid-row: 1 / -1; display: grid !important; grid-template-rows: subgrid; row-gap: 0; container-type: normal; }
.plan-cell:not(:has(> .plan-item + .plan-item)) > .plan-item > .card {
  grid-row: 1 / -1; display: grid !important; grid-template-rows: subgrid; row-gap: 0; align-content: start;
}
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-top,
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-head { display: contents !important; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-title-row { grid-row: 1; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-head > .card-sub { grid-row: 2; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-head > .who,
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-head[data-everyone]::after { grid-row: 3; align-self: start; justify-self: start; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-meta { grid-row: 4; margin-top: 4pt; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-facts { grid-row: 5; margin-top: 2pt; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .chips { grid-row: 6; margin-top: 4pt !important; align-self: start; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-desc { grid-row: 7; }
/* Stacked cards in one cell: a plain column, as before. */
.plan-cell:has(> .plan-item + .plan-item) { grid-row: 1 / -1; }

/* ---------- compact cards (owner, 2026-10-15) ----------
   People tags and "Everyone" start at the left edge, like the times; less air inside
   cards and rows, tighter date lines and lower chips. */
.card .card-head > .who { margin-left: 0 !important; }
.card-head[data-everyone]::after { margin-left: 0 !important; }
.plan-row { padding: 3pt 0 !important; }
.card { padding: 4pt 7pt !important; }
.card-title { line-height: 1.2 !important; }
.card-when { line-height: 1.2 !important; margin-top: 0 !important; }
.card-when .when-time { font-size: 11.5pt !important; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-meta { margin-top: 3pt !important; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .card-facts { margin-top: 1pt !important; line-height: 1.2; }
.plan-cell:not(:has(> .plan-item + .plan-item)) .chips { margin-top: 3pt !important; }
.chip { line-height: 12pt !important; }
.card-desc { margin-top: 2pt !important; line-height: 1.3; }
/* Narrow cards (three or more in a row): one chip per line, filling the card's height
   instead of two side by side; wider cards keep them on one line. */
.plan-row:has(> .plan-cell ~ .plan-cell ~ .plan-cell) .chips { flex-direction: column; align-items: flex-start; }

/* ---------- a little more air, a little smaller (owner, 2026-10-15) ----------
   White space between cards side by side (no line), and the plan at 95 % so more fits. */
.plan-row { column-gap: 10pt !important; }
.board { zoom: 0.95; }
