/* Travel Board v1. Напрям — макети дизайнерки: світлий, синій / бірюзовий, округлі картки, фото, чипи статусів.
   Шрифти з кирилицею і в'єтнамськими літерами: Playfair Display (заголовки), Manrope (інтерфейс).
   Це стара styles/app.css без правил сторінок, яких у v1 нема (пошук, екстрене, цитати, «Ще»); токени ті самі. */
:root {
  --bg: #f5f8fc; --surface: #fff; --surface-2: #f1f5fa; --line: #e3e9f1;
  --ink: #15253d; --ink-2: #45556c; --muted: #636f82; /* ≥ 4,6:1 на білому, --bg і --surface-2 */
  --pill-shadow: 0 1px 3px rgba(21, 37, 61, .1); /* плашки в шапках (.pill) і те, що поруч з ними */
  --navy: #1d3b64; --blue: #2b67c6; --blue-50: #e9f1fc;
  --teal: #16998a; --teal-50: #e1f4f1; --teal-ink: #11796d; /* бірюзовий для тексту: --teal на світлому — лише 3:1 */
  --violet: #7445c4; --violet-50: #f0e9fb;
  --green: #1b7a4f; --green-50: #e2f4ea;
  --amber: #9f5c09; --amber-50: #fcefdb;
  --red: #c23a28; --red-50: #fce8e4;
  --gray: var(--muted); --gray-50: var(--surface-2); /* для чипсів статусу «Скасовано» */
  --sky: #2b67c6; --sky-50: #e9f1fc;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(21, 37, 61, .04), 0 10px 28px rgba(21, 37, 61, .07);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* Windows не малює емодзі-прапори — замість 🇽🇰 показує «XK». Там (клас ставить main.js) підставляємо шрифт лише з прапорами:
   unicode-range — тож решта тексту йде звичними шрифтами. Шрифт: country-flag-emoji-polyfill (MIT), малюнки Twemoji (CC-BY 4.0) */
@font-face { font-family: 'Twemoji Country Flags'; src: url('/assets/fonts/TwemojiCountryFlags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F; font-display: swap; }
html.flag-font { --serif: 'Twemoji Country Flags', 'Playfair Display', Georgia, serif;
  --sans: 'Twemoji Country Flags', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; } /* місце під смугу прокрутки є завжди: короткі й довгі сторінки не зсуваються */
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
/* перемикач так/ні: підпис незмінний, стан показує доріжка — зелена, бігунок праворуч, коли увімкнено.
   Розмітка: <label class="switch"><span>підпис</span><input type="checkbox" role="switch"><i class="switch-k"></i></label> */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.switch-k { position: relative; flex: none; width: 40px; height: 24px; border-radius: 999px; background: #8792a5; transition: background .15s; } /* 3,1:1 на білому */
.switch-k::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(13, 30, 55, .25); transition: transform .15s; }
.switch input:checked ~ .switch-k { background: var(--green); }
.switch input:checked ~ .switch-k::after { transform: translateX(16px); }
.switch input:focus-visible ~ .switch-k { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled ~ .switch-k { opacity: .6; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .switch-k, .switch-k::after { transition: none; } } /* шапку й нижню панель ховаємо атрибутом, а не класом */
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* WebKit (Safari) не обрізає довгий текст вибраного пункта: він розширює сторінку чи форму вбік. overflow не діє, contain: paint — так */
select { contain: paint; }
button { font: inherit; }

/* шапка */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 24px; height: 66px; padding: 0 28px;
  background: rgba(255, 255, 255, .84); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(227, 233, 241, .9); }
.brand { display: flex; align-items: center; gap: 11px; font: 700 22px/1 var(--serif); color: var(--navy); }
.brand svg { width: 34px; height: 34px; }
.mainnav { display: flex; gap: 2px; margin: 0 auto; }
.mainnav a { padding: 9px 15px; border-radius: 999px; font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
.mainnav a:hover { background: var(--surface-2); color: var(--navy); }
.mainnav a[aria-current="page"] { background: var(--blue-50); color: var(--navy); }
.actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--navy); cursor: pointer; }
.icon-btn:hover { background: var(--blue-50); }
.icon-btn .ic { width: 20px; height: 20px; }

/* фільтр людей і профіль у шапці (ТЗ §2: вибір запам'ятовується для кожного профілю) */
/* стрілка своя: браузерна в круглому полі тулилась до самого краю */
.pfilter { padding: 9px 32px 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2);
  font: 700 13.5px var(--sans); cursor: pointer; appearance: none; -webkit-appearance: none; background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636f82' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.pfilter:hover:not(:disabled) { background-color: var(--surface-2); color: var(--navy); }
.pfilter:disabled { opacity: .5; cursor: default; } /* «Речі»: на місці, щоб меню не зсувалось, але не діє */
.who { display: flex; align-items: center; gap: 10px; }
.who-name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--navy); white-space: nowrap; }
.who-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--red); }

/* героїчна шапка сторінки «Зараз» */
/* фото шапки з даних країни: --h1 — оригінал, сервер стискає його до 1920 px при завантаженні; --fy — фокус по висоті (heroY) */
.hero { position: relative; background: #cfe0ea var(--h1) center var(--fy, 50%) / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(245, 248, 252, .97) 0%, rgba(245, 248, 252, .88) 32%, rgba(245, 248, 252, 0) 64%),
              linear-gradient(0deg, var(--bg) 0%, rgba(245, 248, 252, 0) 34%); }
.hero-in { position: relative; min-height: 400px; padding-top: 40px; padding-bottom: 120px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.display { display: flex; align-items: center; gap: 16px; margin: 8px 0 12px; font: 700 clamp(42px, 6vw, 72px)/1.02 var(--serif); color: var(--navy); letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-flag { width: 58px; height: 43px; border-radius: 8px; box-shadow: 0 6px 16px rgba(21, 37, 61, .18); }
.hero-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 17px; font-weight: 700; color: var(--ink); }
.hero-meta .ic { width: 20px; height: 20px; color: var(--navy); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* сітка карток */
.home, .page-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; margin-top: -84px; position: relative; padding-bottom: 48px; align-items: start; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* шапка внутрішніх сторінок і вкладки (tabs) */
.hero-page .hero-in { min-height: 300px; padding-bottom: 110px; }
.page-sub { margin: 0 0 14px; font-size: 18px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; padding: 8px; overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tabs a .ic { width: 18px; height: 18px; }
.tabs a:hover { background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--blue-50); color: var(--navy); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-h h2 { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; font-size: 17px; font-weight: 800; color: var(--navy); overflow-wrap: anywhere; }
.card-h h2 .ic { color: var(--blue); width: 20px; height: 20px; }
.card-h .sub { color: #95a0b1; font-size: 13px; } /* лічильник чи дати в заголовку блока — блідо, щоб не здавались кнопкою */
/* «+» одразу після заголовка блока: швидко додати (задачу) — синій значок без фону, кружок підсвічується при наведенні */
.card-add { position: relative; display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-left: -4px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--blue); cursor: pointer; }
.card-add:hover { background: var(--sky-50); }
.card-add .ic { width: 18px; height: 18px; }
@media (max-width: 760px) { .card-add::after { content: ''; position: absolute; inset: -8px; } } /* ціль дотику ~44 px */
.more { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--blue); white-space: nowrap; }
.more .ic { width: 16px; height: 16px; }
@media (max-width: 760px) {
  a.bk-link, .card-h a.more, .tl-ins-top a.more, .tl-m-h a, a.tl-plate-more, a.notes-crumb { position: relative; }
  a.bk-link::after, .card-h a.more::after, .tl-ins-top a.more::after, .tl-m-h a::after, a.tl-plate-more::after, a.notes-crumb::after {
    content: ''; position: absolute; inset: -11px -8px;
  }
}
.list { margin: 0; padding: 0; list-style: none; }
.empty { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* чипи */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
/* плашки в шапках «Сьогодні» й подорожі: один розмір і тінь, білі й непрозорі; колір — лише в статусу (.pill.chip-…, правила нижче) */
.pill { display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding: 6px 12px; border-radius: 999px; background: #fff;
  box-shadow: var(--pill-shadow); font-size: 13px; font-weight: 700; line-height: 20px; color: var(--ink-2); } /* line-height у px — і для жирної назви 14px усередині: висота та сама */
.chip-green { background: var(--green-50); color: var(--green); }
.chip-amber { background: var(--amber-50); color: var(--amber); }
.chip-sky, .chip-blue { background: var(--sky-50); color: var(--blue); }
.chip-teal { background: var(--teal-50); color: var(--teal-ink); }
.chip-violet { background: var(--violet-50); color: var(--violet); }
.chip-red { background: var(--red-50); color: var(--red); }
.chip-gray { background: var(--surface-2); color: var(--muted); }
.chip-navy { background: var(--navy); color: #fff; }

/* маршрут кружечками */
.strip { display: flex; gap: 4px; margin: 0 -8px; padding: 2px 8px 6px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); } /* згасання справа = «гортається» */
.stop { position: relative; flex: 0 0 124px; display: flex; flex-direction: column; align-items: center; text-align: center; scroll-snap-align: start; }
.stop::before { content: ""; position: absolute; top: 30px; left: 0; right: 0; height: 2px;
  background: repeating-linear-gradient(90deg, #c9d5e5 0 6px, transparent 6px 11px); }
.stop:first-child::before { left: 50%; } .stop:last-child::before { right: 50%; }
.stop-m { font-size: 12px; font-weight: 800; color: var(--muted); }
.stop-dot { position: relative; width: 11px; height: 11px; margin: 8px 0 12px; border-radius: 50%; background: #c9d5e5; box-shadow: 0 0 0 4px #fff; }
.stop.is-now .stop-m { color: var(--blue); }
.stop.is-now .stop-dot { background: var(--blue); box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--blue-50); }
.stop-ph { position: relative; display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: var(--blue-50); color: var(--navy);
  box-shadow: 0 0 0 3px #fff, 0 8px 20px rgba(21, 37, 61, .14); }
.stop-ph .ic { width: 30px; height: 30px; }
.stop-ph .ph { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; } /* absolute — інакше вертикальне фото розтягує кружок в овал */
.stop-ph .flag { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); width: 24px; height: 18px; border-radius: 4px; box-shadow: 0 0 0 2px #fff; }
.stop b { margin-top: 13px; font-size: 14px; line-height: 1.25; color: var(--navy); overflow-wrap: anywhere; }
.stop small { margin: 3px 0 8px; font-size: 12px; line-height: 1.35; color: var(--ink-2); white-space: nowrap; }
.stop .chip { margin-top: auto; } /* усі чипи на одній лінії, навіть якщо текст над ними різної висоти */
.stop.is-past { opacity: .5; }

/* найближчі події */
.ev { display: grid; grid-template-columns: 42px 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.ev + .ev { margin-top: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.tile b { font-size: 21px; font-weight: 800; color: var(--navy); }
.tile span { margin-top: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.ev-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #fff; color: var(--blue); }
.ev-stay { color: var(--teal); } .ev-task { color: var(--amber); } .ev-deadline, .ev-visa { color: var(--red); }
.ev-b { display: flex; flex-direction: column; min-width: 0; }
.ev-t { min-width: 0; font-weight: 800; font-size: 14px; line-height: 1.3; overflow-wrap: break-word; }
.ev-m { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-in { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ev-in.hot { color: var(--red); }

/* підготовка */
.progress-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.progress-row b { font-size: 22px; color: var(--navy); }
.progress { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--blue)); }
/* рядок задачі — сітка: галочка (чи значок) · назва · кружечки людей; деталі — під назвою на всю ширину, зокрема під
   кружечками (раніше кружечки тримали стовпчик на всю висоту, і праворуч під ними лишалась пуста смуга).
   .task-b — лише обгортка (display: contents), її рядки стають у сітку рядка; так само в рядках-посиланнях
   (.now-auto-a, .prep-go), де сітка — на самому посиланні */
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: start;
  padding: 10px 0; border-top: 1px solid var(--line); }
.tasks .task:first-child { border-top: 0; }
.box { flex: none; width: 20px; height: 20px; margin-top: 1px; border: 2px solid #c9d5e5; border-radius: 50%; }
.task-b { display: contents; }
.task-t { grid-column: 2; grid-row: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.task-m { grid-column: 2 / -1; min-width: 0; font-size: 12.5px; color: var(--muted); }
.late, .prio { color: var(--red); font-weight: 700; }

/* житло */
.stay { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.stay:first-child { border-top: 0; padding-top: 2px; }
.stay-ph { width: 76px; height: 64px; border-radius: 14px; object-fit: cover; }
.stay-b { display: flex; flex-direction: column; min-width: 0; }
.stay-t { font-weight: 800; font-size: 14.5px; color: var(--navy); }
.stay-m { font-size: 12.5px; color: var(--ink-2); }
.stay-p { font-size: 12.5px; color: var(--ink-2); }
.stay-c { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--amber); }
.stay-c .ic { width: 14px; height: 14px; }
.stay-w { display: flex; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--amber); }
.stay-w .ic { width: 14px; height: 14px; margin-top: 2px; }
.stay-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* документи й підстави */
.permit { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; padding: 14px 16px; border-radius: 14px; background: var(--blue-50); }
.permit-h { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--navy); }
.permit-h .flag { width: 22px; height: 16px; border-radius: 3px; }
.permit-d { font-size: 13px; font-weight: 700; color: var(--ink); }
.permit-n { font-size: 12.5px; color: var(--ink-2); }
.warn { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 14px; background: var(--red-50); color: var(--red); font-size: 13.5px; font-weight: 700; }
.warn + .warn { margin-top: 8px; }
.warn.soft { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.warn .ic { margin-top: 1px; }

/* сторінки й вхід */
.page { padding-top: 36px; padding-bottom: 80px; }
/* заголовок розділу (lib.js pageHead) — однаковий у Подорожах, Бронюваннях, Документах, Підготовці, Нотатках і Профілі */
.phead { margin: 0 0 18px; }
.phead-t { margin: 0; font: 700 40px/1.1 var(--serif); color: var(--navy); letter-spacing: -.01em; overflow-wrap: anywhere; }
.phead-s { margin: 6px 0 0; font-size: 16px; color: var(--ink-2); }
.lead { color: var(--ink-2); font-size: 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 14px; background: var(--navy); color: #fff;
  font-weight: 800; font-size: 14.5px; cursor: pointer; }
.btn:hover { background: var(--blue); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.ghost { background: var(--surface-2); color: var(--navy); }
.btn.ghost:hover { background: var(--blue-50); }
.btn.danger { background: var(--red-50); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.login { display: grid; place-items: center; min-height: calc(100vh - 66px); padding: 32px 16px; }
.login-card { display: grid; gap: 14px; width: min(380px, 92vw); padding: 30px 26px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.login-card h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font: 700 26px/1 var(--serif); color: var(--navy); }
.login-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-pick button { padding: 16px 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink-2);
  font-weight: 800; font-size: 15px; cursor: pointer; }
.login-pick button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-50); color: var(--navy); }
.login-err { color: var(--red); font-size: 13.5px; font-weight: 700; }

/* нижня панель — лише на телефоні */
.tabbar { display: none; }

@media (max-width: 1100px) {
  .mainnav a { padding: 9px 11px; }
  .span-4 { grid-column: span 6; } .span-7, .span-5 { grid-column: span 12; }
}
/* планшет вертикально й телефон горизонтально (761–1100 px): повна шапка не влазила — лого ламалось на два рядки,
   а на 761–925 px шапка ще й виходила за край (на 844 px — на 61 px), і сторінка гортувалась убік.
   Тісніші відступи, лого в один рядок, вхід — лише кружком, як на телефоні (ім'я — у підказці й на сторінці профілю) */
@media (min-width: 761px) and (max-width: 1100px) {
  .topbar { gap: 14px; padding: 0 20px; }
  .brand { flex: none; gap: 9px; font-size: 19px; white-space: nowrap; }
  .brand svg { width: 30px; height: 30px; }
  .mainnav a { padding: 9px 10px; font-size: 14px; }
  .who-name span { display: none; }
  .who-name { justify-content: center; min-width: 40px; min-height: 40px; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .brand { font-size: 18px; }
  .mainnav a { padding: 8px 7px; font-size: 13.5px; }
}
/* шість пунктів меню, фільтр і профіль разом із назвою не влазили (у Chrome на 761 px — на 52 px за край, на 901 —
   на 24): лише значок, назва — в aria-label посилання */
@media (min-width: 761px) and (max-width: 960px) {
  .brand span { display: none; }
}
@media (min-width: 761px) and (max-width: 800px) { /* iPad mini вертикально (768 px) */
  .topbar { gap: 8px; padding: 0 12px; }
  .mainnav { gap: 0; }
  .mainnav a { padding: 8px 6px; font-size: 13px; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .wrap { padding-left: 16px; padding-right: 16px; } /* не скорочено: «padding: 0 16px» знімав верхній відступ .page */
  .topbar { height: 56px; padding: 0 16px; gap: 10px; justify-content: space-between; }
  .mainnav { display: none; }
  .pfilter { padding: 7px 30px 7px 12px; font-size: 12.5px; background-position: right 11px center; }
  .who-name span { display: none; }
  /* на телефоні фото — смуга вгорі на всю ширину, нижче текст на тлі сторінки */
  .hero { background-position: center top; background-size: auto 280px; background-color: var(--bg); }
  /* фото — смуга 280px; затемнення в пікселях від верху, а не у % від висоти шапки: інакше на високій шапці
     (сторінка подорожі) воно з'їжджало нижче фото і лишався різкий край посеред назви */
  .hero::before { background: linear-gradient(180deg, rgba(245, 248, 252, 0) 110px, rgba(245, 248, 252, .6) 190px, var(--bg) 260px); }
  .card-h { flex-wrap: wrap; }
  .card-h .sub { order: 3; width: 100%; }
  .hero-in { min-height: 0; padding-top: 176px; padding-bottom: 104px; }
    .display { font-size: clamp(30px, 10vw, 44px); }
  .hero-flag { width: 44px; height: 33px; }
  .hero-meta { font-size: 15px; align-items: flex-start; }
  .home { gap: 14px; margin-top: -80px; padding-bottom: 96px; }
  .page-body { padding-bottom: 96px; } /* кінець сторінки не ховається під нижню панель */
  .span-4, .span-7, .span-5, .span-12 { grid-column: span 12; }
  .card { padding: 18px 16px; border-radius: 18px; }
  .stop { flex-basis: 108px; }
  .stay { grid-template-columns: 64px minmax(0, 1fr); }
  .stay-ph { width: 64px; height: 56px; }
  .stay-chips { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .hero .eyebrow { color: var(--ink-2); text-shadow: 0 0 4px #fff, 0 0 10px #fff, 0 0 18px #fff; }
  .login { min-height: calc(100vh - 56px); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 800; color: var(--muted); }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--blue); }
  .page { padding-top: 20px; padding-bottom: 110px; }
  .phead { margin-bottom: 14px; }
  .phead-t { font-size: 30px; }
  .phead-s { margin-top: 4px; font-size: 15px; }
  /* Safari на iPhone збільшує сторінку, коли фокус у полі зі шрифтом менше 16px */
  /* :is — одна сила для всіх трьох, щоб перебити .fld select, .pfilter тощо */
  :is(input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea) { font-size: 16px; }
  .actions { min-width: 0; }
  .pfilter { flex: 0 1 auto; min-width: 0; max-width: 150px; } /* на 360px стискається, а не виштовхує профіль за край */
  /* лого — одним рядком і менше: поруч фільтр людей і профіль */
  .brand { flex: none; gap: 9px; font-size: 18px; white-space: nowrap; }
  .brand svg { width: 30px; height: 30px; }
  /* вкладки, що влазять, ділять ширину порівну; що не влазять — гортаються, як і раніше (shrink 0) */
  .tabs a { flex: 1 0 auto; justify-content: center; }
  .eyebrow { letter-spacing: .14em; line-height: 1.5; }
  /* пальцем: кружок задачі й аватар — ціль дотику ~44px, вигляд той самий */
  .box { position: relative; }
  .box::after { content: ''; position: absolute; inset: -12px; }
  .who-name { justify-content: center; min-width: 40px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.login-card .btn { justify-content: center; }

/* поле дати одним рядком «дд.мм.рррр» (app/dateinput.js): видиме текстове + кнопка календаря,
   значення — у прихованому type=date, через який і відкривається вибір дати */
.dfield { position: relative; display: inline-block; width: 100%; max-width: 100%; vertical-align: middle; }
.dfield > input.dfield-t[type] { width: 100%; padding-right: 40px; }
.dfield > input.dfield-t.is-bad[type] { border-color: var(--red); background: #fffafa; }
.dfield-b { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  transform: translateY(-50%); border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.dfield-b:hover { background: var(--blue-50); color: var(--blue); }
.dfield-b .ic { width: 16px; height: 16px; }
@media (max-width: 760px) { .dfield-b { width: 36px; height: 36px; } }
/* свій календар: тиждень з понеділка (вбудований браузерний починав із неділі) */
.dpick { position: fixed; z-index: 1000; width: 280px; padding: 10px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: 0 14px 36px rgba(21, 37, 61, .18); }
.dpick-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dpick-h b { font-size: 14px; font-weight: 800; color: var(--navy); }
.dpick button { border: 0; background: none; font: 600 13px/1 var(--sans); color: var(--ink); cursor: pointer; }
.dpick-h button { width: 32px; height: 32px; border-radius: 9px; font-size: 20px; color: var(--ink-2); }
.dpick-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dpick-g span { padding: 4px 0 6px; text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); }
.dpick-g button { height: 34px; border-radius: 9px; }
.dpick-g .is-we { color: var(--ink-2); }
.dpick-g .is-today { box-shadow: inset 0 0 0 1.5px var(--blue); font-weight: 800; }
.dpick-g .is-sel { background: var(--blue); color: #fff; font-weight: 800; }
.dpick button:hover:not(.is-sel) { background: var(--blue-50); color: var(--blue); }
.dpick-f { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.dpick-f button { padding: 7px 9px; border-radius: 8px; font-weight: 800; font-size: 12.5px; color: var(--blue); }
.tfield.is-bad[type] { border-color: var(--red); background: #fffafa; }

/* кругла кнопка файлів запису (lib.js filesButton): квитки бронювань, поліс документа — завжди остання праворуч знизу;
   кольори — як у плашки «Транспорт».
   Кілька файлів — цифра в куточку тих самих кольорів, що й кнопка (не яскравіша за неї), з обвідкою кольору фону пункту,
   як у кружечків людей, і меню файлів */
.files-btn { position: relative; display: grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; /* заввишки як плашка стану */
  border-radius: 50%; background: var(--sky-50); color: var(--blue); cursor: pointer; }
.files-btn:hover { background: var(--blue); color: #fff; }
.files-btn .ic { width: 15px; height: 15px; }
.tix-n { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--sky-50); color: var(--blue); font: 800 10px/16px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--ring, #fff); }
.tix-pop { position: fixed; z-index: 30; display: flex; flex-direction: column; gap: 2px; min-width: 212px; max-width: calc(100vw - 16px);
  padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain; } /* висоту обмежує bindTix — решта файлів прокруткою меню */
.tix-pop a { flex: none; }
.tix-pop[hidden] { display: none; }
.tix-pop a { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 10px; font: 700 13.5px var(--sans); color: var(--ink-2); }
.tix-pop a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tix-pop a:hover { background: var(--blue-50); color: var(--navy); }
.tix-pop .ic { flex: none; width: 16px; height: 16px; color: var(--blue); }
/* рядок меню: назва файлу відкриває, значок праворуч — «Завантажити» */
.tix-row { display: flex; flex: none; align-items: center; gap: 2px; }
.tix-row > a[data-pfile] { flex: 1 1 auto; min-width: 0; }
.tix-dl { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px;
  background: none; cursor: pointer; }
.tix-dl:hover { background: var(--blue-50); }
.tix-dl:disabled { opacity: .5; cursor: progress; }
.tv-dl:disabled { opacity: .5; cursor: progress; }
@media (max-width: 760px) { .files-btn::after { content: ''; position: absolute; inset: -9px; } } /* видно 26 px, ціль дотику ~44 px */

/* переглядач картинок-квитків (viewer.js): темне вікно на весь екран; гортання — рідна прокрутка зі snap, по одному кадру */
.tv { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0b111c; color: #fff; }
.tv[open] { display: flex; flex-direction: column; }
.tv::backdrop { background: rgba(10, 16, 28, .6); }
.tv-h { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.tv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; }
.tv-n { flex: none; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.tv-x, .tv-dl, .tv-nav { display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14);
  color: #fff; cursor: pointer; }
.tv-x, .tv-dl { flex: none; width: 40px; height: 40px; }
.tv-x:hover, .tv-dl:hover, .tv-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .24); }
.tv-x .ic, .tv-dl .ic, .tv-nav .ic { width: 20px; height: 20px; }
.tv-track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior: contain; scrollbar-width: none; }
.tv-track::-webkit-scrollbar { display: none; }
.tv-slide { flex: 0 0 100%; min-width: 0; display: grid; place-items: center; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  scroll-snap-align: center; scroll-snap-stop: always; }
.tv-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; background: #fff; }
.tv-err { display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 0; padding: 16px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); font-size: 14px; line-height: 1.45; }
.tv-err .ic { flex: none; width: 20px; height: 20px; color: #ffb4a6; }
.tv-nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; }
.tv-nav:disabled { opacity: .3; cursor: default; }
.tv-prev { left: 12px; }
.tv-prev .ic { transform: scaleX(-1); }
.tv-next { right: 12px; }
@media (hover: none) { .tv-nav { display: none; } } /* на дотиковому екрані гортають пальцем */
