/* Account layout (account-nav.js): menu on the left from 900 px, bar at the bottom with "+" and "Більше" below. */
.account-page .app-main { padding-block: var(--sp-6) var(--sp-8); }
.account-layout { max-width: 1080px; margin-inline: auto; display: grid; gap: var(--sp-6); align-items: start; }
.account-body { display: grid; gap: var(--sp-5); min-width: 0; max-width: 720px; }
.account-body .section-off { display: none; }
/* The page heading names the section; the box heading would repeat it (it still names the box for screen readers). */
.account-body .section-title { display: none; }

.account-icon { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Desktop menu */
.account-nav { display: grid; gap: var(--sp-3); }
.account-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.account-nav-link {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding-inline: var(--sp-3); border-radius: var(--r-md);
  color: var(--c-text); text-decoration: none; font-weight: var(--fw-regular);
}
.account-nav-link .account-badge { margin-left: auto; }
.account-nav-link:hover { background: var(--c-surface); color: var(--c-navy); }
.account-nav-link[aria-current="page"] { background: var(--c-info-soft); color: var(--c-navy); font-weight: var(--fw-semibold); }
.account-nav-link:focus-visible, .account-tab:focus-visible, .account-more-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.account-nav-extra { display: grid; gap: var(--sp-1); padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }
.account-nav-out { color: var(--c-muted); border-top: 1px solid var(--c-border); border-radius: 0; padding-top: var(--sp-2); }

/* Unread messages: navy dot with the number (not colour alone – the number says it) */
.account-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 6px; border-radius: var(--r-full);
  background: var(--c-navy); color: var(--c-surface); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1;
}

/* Phone bar */
.account-tabbar { display: none; }
.account-more { display: none; }

@media (min-width: 900px) {
  .account-layout { grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-7); }
  .account-nav { position: sticky; top: var(--sp-5); }
}

@media (max-width: 899px) {
  .account-page .app-main { padding-top: var(--sp-5); }
  #account-nav { display: none; }
  /* The avatar menu of the header repeats the bar – on phones the bar is the account navigation. */
  .account-page .site-account { display: none; }
  .has-account-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .has-account-tabbar .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .account-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end;
    min-height: 64px; padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom, 0px));
    background: var(--c-surface); border-top: 1px solid var(--c-border);
  }
  .account-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; min-width: 0;
    padding: 0; border: 0; border-radius: var(--r-md); background: none; color: var(--c-muted);
    font: inherit; font-size: var(--fs-sm); line-height: 1.2; text-decoration: none; cursor: pointer;
  }
  .account-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-tab { position: relative; }
  .account-tab[aria-current="page"], .account-tab[data-active="true"] { color: var(--c-navy); font-weight: var(--fw-semibold); }
  /* active item: navy bar on top (not colour alone) */
  .account-tab[aria-current="page"]::before, .account-tab[data-active="true"]::before {
    content: ""; position: absolute; top: 0; left: 50%; width: 24px; height: 3px; margin-left: -12px; border-radius: 0 0 var(--r-sm) var(--r-sm); background: var(--c-navy); }
  .account-tab .account-badge { position: absolute; top: 4px; left: calc(50% + 6px); max-width: none; }
  .account-tab-publish { align-self: center; justify-self: center; width: 52px; height: 52px; min-height: 52px; margin-top: -18px;
    border-radius: var(--r-full); background: var(--c-navy); color: var(--c-surface); box-shadow: var(--shadow-md); }
  .account-tab-publish:hover { background: var(--c-slate); }
  .account-tab-publish .account-icon { width: 26px; height: 26px; stroke-width: 2.2; }

  .account-more[open] {
    display: grid; gap: var(--sp-2); position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 80vh;
    padding: var(--sp-4) var(--gutter) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
    border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--c-surface); color: var(--c-text);
  }
  .account-more::backdrop { background: rgba(15, 36, 56, .4); }
  .account-more-head { display: flex; align-items: center; justify-content: space-between; }
  .account-more-head p { margin: 0; font-weight: var(--fw-semibold); color: var(--c-navy); }
  .account-more-list { display: grid; }
  .account-more-link {
    display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding-inline: var(--sp-2);
    border-bottom: 1px solid var(--c-border); color: var(--c-text); text-decoration: none;
  }
  .account-more-link[aria-current="page"] { color: var(--c-navy); font-weight: var(--fw-semibold); }
  .account-more-out { border-bottom: 0; color: var(--c-muted); }
}

/* "Моя візитка" inside the account layout: same spacing as the other sections, card aligned with them. */
.card-page main > .account-layout { padding-block: var(--sp-6) var(--sp-8); }
.card-page .account-layout .card-main { padding-block: 0; justify-items: start; }
@media (max-width: 899px) {
  .card-page main > .account-layout { padding-top: var(--sp-5); }
  .card-page .account-layout .card-main { justify-items: center; }
}

/* Огляд (overview.js) */
.overview { display: grid; gap: var(--sp-5); }
.overview-link { margin: calc(-1 * var(--sp-3)) 0 0; color: var(--c-muted); overflow-wrap: anywhere; }
.overview-link a { font-weight: var(--fw-semibold); }
.overview-next, .overview-progress { display: grid; gap: var(--sp-3); }
.overview-next h2, .overview-progress h2 { margin: 0; }
.overview-trip { display: grid; gap: var(--sp-2); }
.overview-trip .trip-when { margin: 0; color: var(--c-muted); }
.overview-trip-route { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--c-navy); }
.overview-trip-meta { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.overview-trip .trip-actions { margin-top: var(--sp-2); }
.overview-empty { display: grid; gap: var(--sp-4); justify-items: start; }
.overview-empty p { margin: 0; color: var(--c-muted); }

.progress { height: 8px; border-radius: var(--r-full); background: var(--c-bg); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c-navy); }
.overview-missing { list-style: none; margin: 0; padding: 0; display: grid; }
.overview-missing a { display: flex; align-items: center; min-height: 44px; border-bottom: 1px solid var(--c-border); color: var(--c-navy); font-weight: var(--fw-semibold); text-decoration: none; }
.overview-missing li:last-child a { border-bottom: 0; }
.overview-missing a:hover { text-decoration: underline; }

.overview-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); align-items: stretch; }
.overview-tiles .share-menu { grid-column: 1 / -1; max-width: none; }
.tile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: var(--sp-2) var(--sp-3); align-content: start;
  padding: var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface);
  color: var(--c-text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.tile .account-icon { grid-column: 1; color: var(--c-navy); }
.tile-text { grid-column: 1 / -1; display: grid; gap: 2px; }
.tile-text strong { color: var(--c-navy); font-weight: var(--fw-semibold); }
.tile-text span { color: var(--c-muted); font-size: var(--fs-sm); }
.tile-arrow { grid-column: 2; grid-row: 1; color: var(--c-muted); }
.tile:hover { border-color: var(--c-navy); }
.tile:hover .tile-arrow { color: var(--c-navy); }
.tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Fahrgäste */
.overview-search { display: grid; gap: var(--sp-4); }
.overview-search .field { margin-bottom: 0; }
.overview-search .btn { margin-top: var(--sp-2); }
.overview-driver-cta { display: grid; gap: var(--sp-2); justify-items: start; margin-top: var(--sp-3); padding-top: var(--sp-5); border-top: 1px solid var(--c-border); }
.overview-driver-cta h2 { margin: 0; }
.overview-driver-cta p { margin: 0; }

/* Phones: the tiles become rows in one box, like the "Більше" menu. */
@media (max-width: 640px) {
  .overview-tiles { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); overflow: hidden; }
  .tile { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
    min-height: 60px; border: 0; border-radius: 0; }
  .tile + .tile { border-top: 1px solid var(--c-border); }
  .tile .account-icon, .tile-text, .tile-arrow { grid-column: auto; grid-row: auto; }
  .tile:hover { background: var(--c-bg); }
  .overview-tiles .share-menu { margin: 0 var(--sp-4) var(--sp-3); width: auto; }
}
.overview-progress .panel-text { margin: 0; }
.overview-tiles { align-items: stretch; }
@media (max-width: 480px) {
  .overview-trip .trip-actions .btn { width: auto; flex: 1 1 0; }
}

/* Безпека → Електронна пошта: the hint under both code fields keeps its distance from the button */
#email-confirm-form > .field-hint { margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); }

/* "Мої запити" / "Запити пасажирів" (ADR 030): same rows as "Мої поїздки" */
.segmented-options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.request-form { display: grid; margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--c-border); }
.request-form h3 { margin: 0 0 var(--sp-4); color: var(--c-navy); font-size: var(--fs-lg); }
.request-contacts { margin: 0 0 var(--sp-5); padding: var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--r-md); }
.request-contacts .field:last-child { margin-bottom: 0; }
.request-item-off .trip-item-route { color: var(--c-muted); }

/* "Повідомлення" (messages-panel.js, Paket H): list of conversations, one conversation, first message */
.message-threads { list-style: none; margin: 0; padding: 0; display: grid; }
.message-thread-item + .message-thread-item { border-top: 1px solid var(--c-border); }
.message-thread-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--sp-3); align-items: center;
  padding: var(--sp-3) var(--sp-2); color: var(--c-text); text-decoration: none; border-radius: var(--r-md);
}
.message-thread-link:hover { background: var(--c-bg); }
.message-thread-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.message-thread-head { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.message-thread-name { color: var(--c-navy); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-time { flex: none; color: var(--c-muted); font-size: var(--fs-sm); }
.message-thread-subject { grid-column: 1; color: var(--c-muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-last { grid-column: 1; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-link .account-badge { grid-column: 2; grid-row: 2 / span 2; }
.is-unread .message-thread-last { color: var(--c-text); font-weight: var(--fw-semibold); }

.message-thread { display: grid; gap: var(--sp-4); }
.message-back { margin: 0; }
.message-back a { font-weight: var(--fw-semibold); }
.message-head { display: grid; gap: var(--sp-1); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--c-border); }
.message-with { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--c-navy); overflow-wrap: anywhere; }
.message-with a { color: inherit; }
.message-subject p { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.message-subject .message-subject-state { margin-top: var(--sp-1); color: var(--c-navy); font-weight: var(--fw-semibold); } /* tours: cancelled / ended / deleted */
.message-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.message-day { justify-self: center; margin-top: var(--sp-2); color: var(--c-muted); font-size: var(--fs-sm); }
.message-first { justify-self: stretch; margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--c-info-soft); color: var(--c-navy); font-size: var(--fs-base); }
.message {
  justify-self: start; display: grid; gap: var(--sp-1); max-width: min(85%, 520px); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-sm); background: var(--c-surface);
}
.message.is-mine { justify-self: end; border-color: var(--c-info-soft); border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg); background: var(--c-info-soft); }
.message-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-time { justify-self: end; color: var(--c-muted); font-size: var(--fs-xs); }
.message-offer { display: grid; gap: 2px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--c-border-strong); border-radius: var(--r-md); background: var(--c-surface); }
.message-offer p { margin: 0; }
.message-offer-label { color: var(--c-muted); font-size: var(--fs-sm); }
.message-offer-route { color: var(--c-navy); font-weight: var(--fw-semibold); }
.message-offer-meta, .message-offer-gone { color: var(--c-muted); font-size: var(--fs-sm); }
.message-form { display: grid; gap: var(--sp-2); }
.message-form .field-row { display: flex; justify-content: space-between; gap: var(--sp-3); }
.message-form .counter { margin: 0 0 0 auto; }
.message-form .btn { justify-self: start; }
.message-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid var(--c-border); }
@media (max-width: 480px) { .message-form .btn { justify-self: stretch; } }

/* "Запити пасажирів" (passenger-requests.js): filter box, then one card per request */
.pr-section { display: grid; gap: var(--sp-4); }
.pr-intro { margin: calc(-1 * var(--sp-2)) 0 0; color: var(--c-muted); }
.pr-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); padding: var(--sp-5); }
.pr-filter .field { margin: 0; }
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 32px; }
.pr-count { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.pr-head .link-button { font-size: var(--fs-sm); }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.pr-icon { display: inline-flex; flex: none; }
.pr-icon svg { display: block; }

.pr-card {
  display: grid; gap: var(--sp-3); padding: var(--sp-5); min-width: 0;
  border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface);
}
.pr-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); }
.pr-kind {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: var(--r-full);
  background: var(--c-info-soft); color: var(--c-navy); font-size: var(--fs-sm); font-weight: var(--fw-semibold); line-height: 1.3;
}
.pr-kind .pr-icon svg { width: 16px; height: 16px; }
.pr-period { margin-left: auto; text-align: right; color: var(--c-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; } /* stays right, also when it wraps under the badge on phones */
.pr-route {
  margin: 0; color: var(--c-navy); font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-snug);
  letter-spacing: var(--ls-heading); overflow-wrap: anywhere;
}
.pr-fit { display: flex; align-items: center; gap: 6px; margin: calc(-1 * var(--sp-1)) 0 0; color: var(--c-navy); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.pr-person { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.pr-avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--c-bg); color: var(--c-navy); font-weight: var(--fw-semibold);
}
.pr-who { margin: 0; color: var(--c-muted); overflow-wrap: anywhere; }
.pr-who strong { color: var(--c-text); font-weight: var(--fw-semibold); }
.pr-note { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--c-bg); color: var(--c-text); white-space: pre-line; overflow-wrap: anywhere; }
.pr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-1); padding-top: var(--sp-4); border-top: 1px solid var(--c-border); }
.pr-contacts { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pr-contact { padding-inline: var(--sp-4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-contact .pr-icon { color: var(--c-navy); }
.pr-empty { display: grid; gap: var(--sp-1); padding: var(--sp-6) var(--sp-5); text-align: center; }
.pr-empty p { margin: 0; }
.pr-empty-title { color: var(--c-navy); font-weight: var(--fw-semibold); }
.pr-empty-text { color: var(--c-muted); }

@media (max-width: 360px) {
  .pr-filter.pr-filter { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pr-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--sp-4); }
  .pr-card { padding: var(--sp-4); }
  .pr-route { font-size: var(--fs-lg); }
  .pr-actions, .pr-contacts { display: grid; grid-template-columns: minmax(0, 1fr); }
  .pr-contacts { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .pr-actions .btn { width: 100%; }
}

/* "Поїздки": conversations about a trip (Paket H) */
.trip-item-talks { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-2); color: var(--c-navy); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.trip-item-talks svg { flex: none; }
.trip-item-talks.has-unread::after { content: ""; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--c-navy); }
/* "Повідомлення" filtered to one trip */
.message-filter { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-1) var(--sp-4); margin-bottom: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--c-info-soft); color: var(--c-navy); }
.message-filter p { margin: 0; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.message-filter a { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }

/* Paket B: one calm line under "Поїздку опубліковано" */
.trips-follow { margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); color: var(--c-muted); font-size: var(--fs-sm); }
.trips-follow a { font-weight: var(--fw-semibold); }

/* "Для соцмереж" (social-dialog.js): format, preview, share / save */
.social-dialog { width: min(520px, calc(100% - 2 * var(--gutter))); max-height: calc(100dvh - 2 * var(--sp-5)); padding: var(--sp-5);
  border: 0; border-radius: var(--r-lg); background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-md); }
.social-dialog[open] { display: grid; gap: var(--sp-3); overflow: auto; }
.social-dialog::backdrop { background: rgba(15, 36, 56, .45); }
.social-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.social-head h2 { margin: 0; color: var(--c-navy); font-size: var(--fs-lg); }
.social-formats { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-md); background: var(--c-bg); }
.social-formats button { min-height: 44px; border: 0; border-radius: var(--r-sm); background: none; color: var(--c-muted); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; }
.social-formats button[aria-pressed="true"] { background: var(--c-surface); color: var(--c-navy); box-shadow: var(--shadow-sm); }
.social-formats button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.social-hint { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }
.social-switch { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; cursor: pointer; font-weight: var(--fw-semibold); color: var(--c-text); }
.social-switch input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--c-navy); cursor: pointer; }
.social-switch input:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.social-preview { display: grid; place-items: center; min-height: 200px; padding: var(--sp-3); border-radius: var(--r-md); background: var(--c-bg); }
.social-preview img { display: block; width: auto; max-width: 100%; max-height: min(56dvh, 520px); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.social-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-2); }
.social-text { display: grid; gap: var(--sp-3); padding-top: var(--sp-4); border-top: 1px solid var(--c-border); }
.social-text h3 { margin: 0; color: var(--c-navy); font-size: var(--fs-base); }
.social-platforms { grid-template-columns: repeat(2, 1fr); gap: 4px; }
@media (min-width: 520px) { .social-platforms { grid-template-columns: repeat(4, auto); } }
.social-textarea { min-height: 220px; height: auto; padding: var(--sp-3); line-height: var(--lh-body); resize: vertical; white-space: pre-wrap; }
.social-copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.social-copied { margin: 0; color: var(--c-navy); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
@media (max-width: 899px) {
  .social-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); }
}

/* One-time note after the onboarding (account.js showWelcome) */
.welcome-notice { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg); background: var(--c-success-soft); }
.welcome-notice p { margin: 0; }
.welcome-notice-title { color: var(--c-success); font-weight: var(--fw-semibold); }
.welcome-notice .welcome-notice-follow { margin-top: var(--sp-1); color: var(--c-text); }
.welcome-notice-follow a { font-weight: var(--fw-semibold); }

/* "Посилки літаком" (flights-panel.js): cards like "Запити пасажирів" */
.flight-cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.flight-form { display: grid; }
.flight-form h3 { margin: 0 0 var(--sp-4); color: var(--c-navy); font-size: var(--fs-lg); }
.pr-mine { color: var(--c-muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
@media (max-width: 480px) { .flight-cta .btn { flex: 1 1 100%; } }
.pr-route-link { color: inherit; text-decoration: none; }
.pr-route-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pr-route-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* "Посилки літаком": counts in the tabs, filter toggle, the e-mail hint */
.tab-count { color: var(--c-muted); font-weight: var(--fw-regular); }
[aria-selected="true"] > .tab-count { color: inherit; }
.flight-head-actions { display: flex; align-items: center; gap: var(--sp-3); }
.flight-alert-hint { display: flex; align-items: center; gap: var(--sp-2); margin: calc(-1 * var(--sp-1)) 0 0; color: var(--c-muted); font-size: var(--fs-sm); }
.flight-alert-hint svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button.pr-mine { min-height: 44px; padding: 0; color: var(--c-navy); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.flight-filter-toggle {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-3) 0 var(--sp-3);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md); background: var(--c-surface); color: var(--c-navy);
  font: var(--fw-semibold) var(--fs-sm)/1 var(--font); cursor: pointer;
}
.flight-filter-toggle:hover { border-color: var(--c-navy); }
.flight-filter-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.flight-filter-toggle[aria-expanded="true"] { border-color: var(--c-navy); background: var(--c-info-soft); }
.flight-filter-icon, .flight-filter-chevron { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flight-filter-chevron { transition: transform .15s ease; }
.flight-filter-toggle[aria-expanded="true"] .flight-filter-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .flight-filter-chevron { transition: none; } }

/* "Мої" in "Посилки літаком": equal buttons, then page link (left) and "Видалити" (right) */
.pr-manage { display: grid; gap: var(--sp-3); }
.pr-manage-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
@media (max-width: 640px) {
  .pr-manage-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-manage-buttons > :last-child:nth-child(odd) { grid-column: 1 / -1; } /* a lone last button takes the full row */
}
.pr-manage-buttons .btn { width: 100%; }
.pr-manage-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.pr-page-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-navy); font-weight: var(--fw-semibold); }
.pr-delete { min-height: 44px; margin-left: auto; }
.pr-period .badge-active, .pr-period .badge-soon { margin-left: var(--sp-1); vertical-align: middle; }

/* "Проміжні зупинки" (trips-panel.js): one place field per stop with a remove button, "+ Додати зупинку" below */
.trip-stops { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.trip-stops:empty { display: none; }
.trip-stop { display: grid; grid-template-columns: minmax(0, 1fr) var(--control-h); gap: var(--sp-2); align-items: start; }
.trip-stop .place-error { grid-column: 1 / -1; margin: 0; }
.trip-stop-remove {
  display: inline-flex; align-items: center; justify-content: center; width: var(--control-h); height: var(--control-h);
  padding: 0; border: 1px solid var(--c-border-strong); border-radius: var(--r-md); background: var(--c-surface);
  color: var(--c-navy); cursor: pointer;
}
.trip-stop-remove:hover { border-color: var(--c-slate); color: var(--c-slate); }
.trip-stop-remove:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.trip-stop-add { justify-self: start; }
.trip-stops-field { display: grid; }

/* "Мої подорожі" (ADR 031): rows of several fields (extras: name + price; pick-up: city + place + time). */
.tour-row-fields { display: grid; gap: var(--sp-2); min-width: 0; }
#tour-extras .tour-row-fields { grid-template-columns: minmax(0, 1fr) 7rem; }
#tour-pickups .tour-row-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 9rem; }
.tour-row-fields .place-error { grid-column: 1 / -1; margin: 0; }
.tour-pickup, .tour-confirm { display: grid; gap: var(--sp-3); border: 0; padding: 0; min-width: 0; }
.tour-pickup legend, .tour-confirm legend { padding: 0; margin-bottom: var(--sp-2); }
.tour-pickup .check, .tour-confirm .check { margin: 0; }
.tours-locked, .tour-photos-later { margin: 0 0 var(--sp-4); padding: var(--sp-4); border-radius: var(--r-md); }
.tours-locked p { margin: 0; }
.tour-home-fields { display: grid; gap: var(--sp-2); }
.tour-home-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) {
  #tour-pickups .tour-row-fields, #tour-extras .tour-row-fields { grid-template-columns: minmax(0, 1fr); }
}
