/* The two pages outside a trip: Your trips (/trips) and a trip's people and settings
   (/trips/<id>). They are drawn like the account page (styles.css's kit, css/account.css's
   .ac-* and .lg-*); what is here is only what they need on top, as .tr-*. No colors of their
   own: the tokens, and a person's own note colour as a ring around their initials (the
   initials say who; the colour never does alone). */

/* Where else to go, under the heading: back to the list, into the app, to the account. */
.tr-nav { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: calc(-1 * var(--sp-2)); }
.tr-nav .btn .ac-ico, .tr-row-btn .ac-ico, .tr-row-acts .ac-ico { width: 17px; height: 17px; margin-top: 0; color: inherit; }
.btn-primary .ac-ico { color: inherit; }

/* No connection: the words say what still works and what needs one. */
.tr-offline { align-items: flex-start; }

.tr-strong { font-weight: 650; color: var(--ink); }
.tr-sub { margin: var(--sp-2) 0 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.tr-help { margin: 2px 0 0; font-size: 13px; }
.tr-inline-ico { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* A trip in the list: its name opens it in the app; the button beside it, its people. */
.tr-trip-name { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.tr-trip-name:hover { text-decoration-thickness: 2px; }
.tr-row-btn { gap: 6px; }

/* Every row on these pages: its icon (or a person's initials) in a column of its own, the words
   beside it, and its buttons at the end. On a phone the buttons go under the words, in the
   words' column; the icon never leaves its column. A grid, not a wrapping flex row, so nothing
   can drop the icon onto a line of its own. */
[data-trips-page] .ac-way, [data-trip-people-page] .ac-way {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--sp-3);
  row-gap: var(--sp-2);
}
[data-trips-page] .ac-way > .ac-ico, [data-trip-people-page] .ac-way > .ac-ico,
[data-trip-people-page] .ac-way > .tr-initials, [data-trips-page] .ac-way > .tr-cover { grid-column: 1; grid-row: 1; }
[data-trips-page] .ac-way > .ac-way-main, [data-trip-people-page] .ac-way > .ac-way-main { grid-column: 2; grid-row: 1; }
[data-trips-page] .ac-way > .btn, [data-trip-people-page] .ac-way > .btn,
[data-trip-people-page] .ac-way > .tr-row-acts { grid-column: 3; grid-row: 1; align-self: center; }
@media (max-width: 560px) {
  [data-trips-page] .ac-way > .btn, [data-trip-people-page] .ac-way > .btn,
  [data-trip-people-page] .ac-way > .tr-row-acts { grid-column: 2 / -1; grid-row: 2; justify-self: start; }
}
/* A person's buttons ("Send a link to rejoin as <their name>", "Remove") are as wide as the card's own column on a
   desktop, where the page has two columns: beside the name they left it a letter's width. Under the name, at any
   width, as on a phone. */
[data-trip-people-page] .ac-way > .tr-row-acts { grid-column: 2 / -1; grid-row: 2; justify-self: start; justify-content: flex-start; }
/* A guest's rejoin link (trip-people.js rejoinBox): the whole width, under the row. */
[data-trip-people-page] .ac-way > .tr-rejoin { grid-column: 1 / -1; grid-row: 3; }
.tr-none { display: flex; flex-direction: column; gap: var(--sp-1); }
.tr-none .lead { margin: 0; }

/* An offer to host: a card of its own, with what hosting means before the buttons. */
.tr-offers { display: flex; flex-direction: column; gap: var(--sp-4); }
.tr-offer { border: 2px solid var(--accent); }
.tr-offer-head { display: flex; align-items: flex-start; gap: var(--sp-2); }
.tr-offer-head .ac-ico { color: var(--accent); }
.tr-offer-head .h3 { margin: 0; overflow-wrap: anywhere; }

/* Dates: two fields side by side where there is room, under one legend. */
.tr-dates { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-2) var(--sp-3); }
.tr-legend { padding: 0; margin-bottom: var(--sp-2); font-size: 12.5px; font-weight: 650; letter-spacing: .03em; color: var(--ink-3); text-transform: uppercase; }
.tr-legend-note { text-transform: none; letter-spacing: 0; font-weight: 500; }
.tr-dates .field > label { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-2); font-size: 13.5px; }

/* The trip's currencies, in order: the first is marked "main" in words. */
.tr-curs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-1); }
.tr-curs[hidden] { display: none; }
.tr-cur {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 0 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 14px;
}
.tr-cur-code { font-weight: 700; letter-spacing: .02em; }
.tr-cur-name { color: var(--ink-2); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-cur-main { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tr-cur-off {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer;
}
.tr-cur-off svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tr-cur-off:active { background: var(--surface-2); }
/* A guessed currency: a dashed edge and the word "guess" in its chip, and a sentence under the
   chips that says where it came from (public/js/trip-kit.js currencyPicker). */
.tr-cur[data-guess] { border-style: dashed; }
.tr-cur-why { flex: 1 0 100%; margin: 0; }

.tr-interests { min-height: 96px; resize: vertical; font: inherit; line-height: 1.45; }

/* Storage: the numbers in words first; the bar shows the same, never instead. */
.tr-meter { display: flex; flex-direction: column; gap: var(--sp-2); }
.tr-meter-words { margin: 0; font-size: 16px; color: var(--ink); }
.tr-meter .meta { margin: 0; }
.tr-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.tr-bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: inherit; }

/* A person: their initials in a ring of their note colour, the name beside it. */
.tr-initials {
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--tr-dot, var(--line-strong));
  background: var(--surface);
  color: var(--ink); font-size: 12px; font-weight: 750; letter-spacing: .02em;
}
.tr-row-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
@media (max-width: 560px) { .tr-row-acts { justify-content: flex-start; } }

/* Links: the form's two choices and its button on one line where there is room. */
.tr-link-form .field { flex: 1 1 130px; }
.tr-made { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); }
.tr-made[hidden] { display: none; }
.tr-made .tr-sub { margin: 0; }
.tr-made-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.tr-made .meta { margin: 0; }

/* Deleting: a dialog over the page, the warning color on the one button that deletes. */
.tr-dialog {
  width: min(520px, calc(100vw - 2 * var(--sp-4)));
  max-height: calc(100dvh - 2 * var(--sp-4));
  overflow: auto;
  padding: var(--sp-5);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.tr-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.tr-dialog .h3 { margin: 0; overflow-wrap: anywhere; }
.tr-dialog .field > label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.btn.tr-destroy-now:not([disabled]) { background: var(--warn); border-color: var(--warn); color: var(--ground); }
.btn.tr-destroy-now[disabled] { opacity: .5; }

/* A trip's name and its dates read as one thing: the wordmark sits beside the name where there
   is room, and above both where there isn't; never between them. */
.tr-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title brand";
  align-items: end;
  column-gap: var(--sp-3);
  row-gap: var(--sp-3);
}
.tr-head > .tr-title { grid-area: title; display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.tr-head > .tr-title .h1 { margin: 0; }
.tr-head > .tr-title .meta { margin: 0; }
.tr-head > .ac-brand { grid-area: brand; }
@media (max-width: 560px) {
  .tr-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "title"; }
}

/* The time zone's list: /css/zone-picker.css (the app's plan sheet uses the same control). */

/* "New messages" on a trip's row: a link to its chat, as a pill (an icon and the words). The
   pill is small; its tap area is the app's 44px. */
.tr-new { position: relative; text-decoration: none; }
.tr-new::after { content: ""; position: absolute; inset: -10px -6px; }
.tr-new:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A trip's cover on its row (model §6), in the icon's place: square, cropped, the radius of the
   app's small things. */
.tr-cover { flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover;
  background: var(--surface-2); align-self: flex-start; }

/* The trip's cover on its page (trip-people.html): the picture beside its buttons (photo-hand.js),
   larger than a row's, cropped square like it. */
.tp-cover { margin: var(--sp-3) 0 var(--sp-4); }
.tp-cover-row { display: flex; gap: var(--sp-3); align-items: flex-start; margin-top: var(--sp-2); }
.tp-cover-pic { flex: 0 0 auto; width: 72px; height: 72px; border-radius: var(--r-sm); background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden; }
.tp-cover-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-cover-acts { flex: 1 1 auto; min-width: 0; }
.tp-cover-acts .ph { margin-top: 0; }
