/* сторінка /notes — документ як у Notion: білий аркуш, одна колонка ~760px, читання й редагування
   в тій самій типографіці. Спільні класи (card, chip, btn, chips, dlg) — у base.css і forms.css.
   У предків .notes-lb не має бути transform/filter: підказка адреси позиціонується position: fixed. */
.notes { max-width: 916px; } /* аркуш 860px із полями .wrap по 28px → колонка тексту рівно 760px */
.notes.page { padding-bottom: 96px; } /* верх — як у всіх розділів (.page) */
.notes-doc { min-width: 0; padding: 26px 50px 40px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }

/* верхній рядок: звідки нотатка + дії */
.notes-top { display: flex; align-items: center; gap: 14px; min-height: 40px; margin-bottom: 24px; }
.notes-crumb { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 800; color: var(--blue); }
.notes-crumb:hover { color: var(--navy); }
.notes-flag { width: 22px; height: 16px; border-radius: 3px; }
.notes-acts { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.notes-acts .btn { padding: 10px 16px; }
.notes-status { max-width: 34ch; font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: right; }
.notes-status.is-ok { color: var(--green); white-space: nowrap; }
.notes-status.is-bad { color: var(--red); }
.notes-kill { display: grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 0;
  border-radius: 12px; background: none; color: var(--muted); cursor: pointer; }
.notes-kill:hover { background: var(--red-50); color: var(--red); }
.notes-kill .ic { width: 18px; height: 18px; }

/* липка панель інструментів — лише в редагуванні; на телефоні гортається вбік */
.notes-tb { position: sticky; top: 74px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 3px;
  margin: 0 -10px 24px; padding: 5px 6px;
  background: rgba(255, 255, 255, .98); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.notes-tb::-webkit-scrollbar { display: none; }
.notes-tb-b { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink-2);
  font: 700 13px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.notes-tb-b:hover { background: var(--surface-2); color: var(--navy); }
.notes-tb-b[aria-pressed="true"] { background: var(--blue-50); border-color: #d8e5f8; color: var(--navy); }
.notes-tb-b[disabled] { opacity: .5; cursor: progress; }
.notes-tb-ic { width: 16px; height: 16px; }
.notes-tb-sep { flex: none; width: 1px; height: 20px; margin: 0 5px; background: var(--line); }

/* назва: той самий шрифт, що й заголовки сторінок; у редагуванні — просто той самий елемент із contenteditable */
.notes-title { margin: 0 0 18px; font: 800 clamp(26px, 3.4vw, 38px)/1.2 var(--sans); letter-spacing: -.01em; color: var(--navy);
  letter-spacing: -.01em; overflow-wrap: anywhere; }
.notes-title[contenteditable="true"] { border-radius: 10px; }
.notes-title[contenteditable="true"]:focus { outline: 0; box-shadow: 0 0 0 3px var(--blue-50); }
.notes-title:empty::before { content: attr(data-ph); color: var(--muted); }
.notes-title.bad { color: var(--red); }

/* властивості документа: підпис ліворуч, значення праворуч */
.notes-prop-e { margin: 4px 0 0; font-size: 12.5px; font-weight: 700; color: var(--red); }
.notes-prop-e:empty { display: none; }
/* редагування: один рядок без підписів — подорож (чи країна) · дата · «бачить» … «Готово» праворуч
   (там само, де в читанні). Усе однакової висоти; лінія відділяє текст */
.notes-edit { margin: -6px 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.notes-erow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.notes-erow select.notes-in, .notes-erow .dfield > input.dfield-t[type] { box-sizing: border-box; height: 40px; padding-top: 0; padding-bottom: 0; }
.notes-erow [data-stage] { min-width: 0; max-width: 270px; field-sizing: content; } /* ширина — за вибраною подорожжю, не за найдовшою в списку */
.notes-erow .dfield:has(> .notes-in) { width: 150px; }
.notes-share { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; }
.notes-erow .chip-pick span { box-sizing: border-box; height: 40px; padding-top: 0; padding-bottom: 0; }
.notes-erow .notes-ready { margin-left: auto; }
.notes-edit > .notes-prop-e { margin: 8px 0 0; }
.notes-edit.bad [data-stage], .notes-edit.bad [data-country] { border-color: var(--red); background: #fffafa; }
.notes-dim { font-weight: 600; color: var(--muted); }
.notes-pp { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--c, var(--blue)); color: #fff; font-size: 11px; line-height: 1; font-weight: 800; }
.notes-in { max-width: 100%; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 600 14px/1.4 var(--sans); }
.notes-in:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
select.notes-in { min-width: 240px; }

/* «План готовий» (ТЗ v2 §3) — ручна галочка: у читанні натискаєш і зберігається одразу */

/* текст: одна типографіка для читання й редагування */
.notes-body { min-width: 0; font: 400 17px/1.75 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.notes-body > *:first-child { margin-top: 0; }
.notes-body p { margin: 0 0 .8em; }
.notes-body h2 { margin: 1.7em 0 .5em; font: 800 23px/1.3 var(--sans); color: var(--navy); }
.notes-body h3 { margin: 1.5em 0 .45em; font: 800 18.5px/1.35 var(--sans); color: var(--navy); }
.notes-body ul, .notes-body ol { margin: 0 0 .8em; padding-left: 1.5em; }
.notes-body li { margin: .3em 0; }
.notes-body li::marker { color: var(--muted); font-weight: 700; }
.notes-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.notes-body a:hover { color: var(--navy); }
.notes-body img { width: 100%; height: auto; margin: 20px 0; border-radius: 16px; box-shadow: 0 8px 22px rgba(21, 37, 61, .12); }
.notes-body hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.notes-none { margin: 0; }

/* чекліст: галочка — перший елемент пункта; виглядає однаково в обох режимах */
.notes-body ul[data-check], .notes-body ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 1px; }
.notes-body ul[data-check] > li, .notes-body ul:has(> li > input[type="checkbox"]) > li { display: flex; align-items: flex-start; gap: 10px; }
.notes-body input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: .3em 0 0; accent-color: var(--blue); cursor: pointer; }
.notes-body li[data-checked] { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(124, 136, 155, .55); }

/* редагування: те саме поле, тільки вище й із місцем внизу — план на три дні має вміщатись */
.notes-body[contenteditable="true"] { min-height: 60vh; padding-bottom: 26vh; border-radius: 10px; }
.notes-body[contenteditable="true"]:focus { outline: 0; }
.notes-body-blank > p:first-child::before { content: attr(data-ph); color: var(--muted); pointer-events: none; }
.notes-body[contenteditable="true"] img { cursor: default; }

/* підказка адреси — під виділенням */
.notes-lb { position: fixed; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(21, 37, 61, .22); }
.notes-lb-sel { max-width: 150px; overflow: hidden; font-size: 12.5px; font-weight: 700; color: var(--muted);
  text-overflow: ellipsis; white-space: nowrap; }
.notes-lb-i { width: 250px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 600 14px/1.35 var(--sans); }
.notes-lb-i:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.notes-lb .btn { flex: none; padding: 8px 13px; border-radius: 10px; font-size: 13px; white-space: nowrap; }

/* підтвердження (видалення, вихід зі змінами) — рідний <dialog> із класами forms.css */
.notes-dlg { width: min(440px, calc(100vw - 24px)); }
.notes-dlg .dlg-b { padding: 20px 24px 24px; }
.notes-dlg .dlg-ask .row { flex-wrap: wrap; }

@media (max-width: 760px) {
  .notes { max-width: none; }
  .notes.page { padding-bottom: 104px; }
  .notes-doc { padding: 16px 16px 24px; border-radius: 18px; }
  .notes-top { flex-wrap: wrap; gap: 8px; min-height: 0; margin-bottom: 16px; }
  .notes-crumb { flex: 1 1 auto; }
  .notes-acts { width: 100%; margin-left: 0; }
  .notes-status { max-width: none; flex: 1 1 auto; text-align: left; }
  .notes-tb { top: 62px; flex-wrap: nowrap; margin: 0 -6px 18px; padding: 5px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .notes-title { margin-bottom: 14px; font-size: 27px; }
  select.notes-in, .notes-in { width: 100%; min-width: 0; }
  .notes-body { font-size: 16px; line-height: 1.7; }
  .notes-body h2 { font-size: 23px; }
  .notes-body h3 { font-size: 19px; }
  .notes-body img { margin: 14px 0; border-radius: 12px; }
  .notes-body hr { margin: 22px 0; }
  .notes-body[contenteditable="true"] { min-height: 50vh; padding-bottom: 18vh; }
  .notes-lb { left: 8px !important; right: 8px; flex-wrap: wrap; } /* місце підказки рахує редактор — на телефоні вона на всю ширину */
  .notes-lb-sel { flex: 1 1 100%; max-width: none; }
  .notes-lb-i { flex: 1 1 120px; width: auto; }
  .notes-dlg { width: 100vw; max-height: 100vh; border-radius: 0; }
}

/* дата нотатки — вузьке поле, а не на весь рядок */
.dfield:has(> .notes-in) { width: 170px; }

/* нотатка поїздки в читанні: назва поїздки ліворуч, «Готово» праворуч */
/* читання: під назвою один рядок — дата й «бачить» ліворуч, готовність плану праворуч; лінія відділяє текст */
.notes-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: -6px 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.notes-meta-l { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.notes-meta-l .notes-pp { margin-left: -2px; }
.notes-sep { font-style: normal; color: var(--muted); }
