/* The owner's feedback button and its panel (STORY-01.11), with the picture of the screen and its
   marking tools (STORY-01.14). Only drawn when the server is started
   with OWNER_FEEDBACK=1. A small button floating at the window's bottom-right, in the same place on every page and over the
   work pop-up (owner, 2026-11-22; work-pop.js carries it into the open dialog for the top layer): it takes no room in any
   bar, and it floats above the bars that stay at the bottom (a run's pager is 101 px from the window's foot at 1280; a
   phone's reading pull-up 132 px, its tab bar 65 px), so it covers neither Submit nor the pager. Over the page's own
   content it floats, as the owner asked.
   STORY-04.58: the panel has two tabs, New note and Notes (the list of every note with its status). */

.owner-fb {
  position: fixed; z-index: 50; top: auto; left: auto;
  right: max(8px, env(safe-area-inset-right)); bottom: 112px;
  min-width: 44px; min-height: 44px; padding: 0 var(--s4);
  border: 0; border-radius: 999px; background: var(--ink); color: var(--surface);
  font-family: var(--text); font-size: var(--fs-m); font-weight: 700; line-height: 1;
  box-shadow: var(--float);
}
.owner-fb:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 3px; border-radius: 999px; }
.owner-fb:active { transform: scale(0.97); }

/* The panel: near the top, so an on-screen keyboard rising from the bottom leaves the text box and
   Send in view; it scrolls inside itself when the window is shorter still. */
.dialog.owner-note {
  width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 16px); overflow: auto;
  padding: var(--s5);
}
.owner-note__form { display: grid; gap: var(--s3); }
.owner-note h2 { font-size: var(--fs-2xl); }
.owner-note__kinds { display: flex; flex-wrap: wrap; gap: var(--s2); }
.owner-note__kinds label {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
  border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line-2); background: var(--surface);
  font-weight: 700; cursor: pointer;
}
.owner-note__kinds input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.owner-note__kinds label:has(input:checked) { background: var(--ink); color: var(--surface); box-shadow: none; }
.owner-note__kinds label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.owner-note__text { width: 100%; min-height: 96px; }
.owner-note__saved { font-size: var(--fs-s); }
.owner-note__error, .owner-note__no-picture { color: var(--coral-ink); font-weight: 700; }
.owner-note__leave-out { font-weight: 700; }

/* The picture and its marking tools. The picture is never taller than about half the window, so the
   panel can still be scrolled by dragging outside it: dragging on the picture draws, it never scrolls
   or zooms the page. */
.owner-mark { display: grid; gap: var(--s2); }
.owner-mark__frame { display: flex; justify-content: center; padding: var(--s1); border-radius: var(--r-s); background: var(--paper-2); }
.owner-mark__picture {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 45dvh;
  border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair;
}
.owner-mark__tools { display: flex; flex-wrap: wrap; gap: var(--s2); }
.owner-mark__tools .btn { min-width: 44px; }
.owner-mark__tool[aria-pressed="true"] { --face: var(--ink); --on: var(--surface); --lipc: var(--ink); box-shadow: none; }
.owner-note__actions { display: flex; justify-content: flex-end; gap: var(--s3); }

/* The two tabs. */
.owner-note__tabs { display: flex; gap: var(--s2); margin-top: var(--s3); border-bottom: 2px solid var(--line-2); }
.owner-note__tab {
  min-height: 44px; padding: 0 var(--s4); border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px;
  background: transparent; color: var(--ink-2); font: inherit; font-weight: 700; cursor: pointer;
}
.owner-note__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.owner-note__tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--r-s); }
.owner-note__pane { margin-top: var(--s3); }
.owner-note__pane[hidden] { display: none; }

/* The Notes list. Status is told by the fill and the edge, with one accent (teal): a draft is dashed, a sent note is
   outlined, seen is filled paper, planned and answered are teal-tinted, fixed is solid teal, won't do is solid ink. */
.owner-notes__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.owner-notes__heading { margin: 0; font-size: var(--fs-l); }
.owner-notes__heading:focus { outline: none; }
.owner-notes__message { font-weight: 700; color: var(--teal-deep); }
.owner-notes__message:empty { display: none; }
.owner-notes__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.owner-notes__title { display: grid; gap: var(--s1); min-width: 0; }
.owner-notes__counts { margin: 0; font-weight: 700; }
.owner-notes__hint { margin: 0; }
.owner-notes__filters { display: flex; flex-wrap: wrap; gap: var(--s2); }
.owner-notes__chip {
  min-height: 44px; padding: 0 var(--s3); border: 0; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line-2);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
}
.owner-notes__chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }
.owner-notes__chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.owner-notes__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); margin: 0; padding: 0; list-style: none; }
.owner-notes__item { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--s2); padding: var(--s3); border-radius: var(--r-s); box-shadow: inset 0 0 0 1px var(--line-2); background: var(--surface); }
.owner-notes__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.owner-notes__route { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-s); font-weight: 700; color: var(--ink-2); }
.owner-notes__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s3); }
.owner-notes__main { flex: 1 1 200px; min-width: 0; display: grid; gap: var(--s2); }
.owner-notes__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.owner-notes__meta, .owner-notes__reason { margin: 0; font-size: var(--fs-s); color: var(--ink-2); }
.owner-notes__reason { overflow-wrap: anywhere; }
.owner-notes__pic {
  flex: none; display: block; padding: 0; border: 0; border-radius: 6px; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line-2);
  cursor: zoom-in; overflow: hidden; line-height: 0;
}
.owner-notes__pic:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.owner-notes__img { display: block; width: 120px; height: 75px; object-fit: cover; object-position: top left; }
.owner-notes__pic.is-large { flex: 1 1 100%; cursor: zoom-out; }
.owner-notes__pic.is-large .owner-notes__img { width: 100%; height: auto; object-fit: contain; }
.owner-notes__pic.is-failed { min-width: 120px; min-height: 75px; }
.owner-notes__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.owner-notes__ask { font-weight: 700; }
.owner-notes__edit { display: grid; gap: var(--s2); }
.owner-notes__edit-label { font-size: var(--fs-s); font-weight: 700; }
.owner-notes__empty { margin: 0; color: var(--ink-2); }
.owner-status {
  flex: none; display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--s3); border-radius: 999px;
  font-size: var(--fs-s); font-weight: 700; line-height: 1.2; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--edge);
}
.owner-status--draft { background: transparent; box-shadow: none; border: 2px dashed var(--edge); }
.owner-status--seen { background: var(--paper-2); box-shadow: none; }
.owner-status--planned { background: var(--teal-tint); color: var(--teal-deep); box-shadow: none; }
.owner-status--answered { background: var(--teal-tint); color: var(--teal-deep); box-shadow: inset 0 0 0 2px var(--teal); }
.owner-status--fixed { background: var(--teal); color: var(--on-teal); box-shadow: none; }
.owner-status--wont-do { background: var(--ink); color: var(--surface); box-shadow: none; }

@media (max-width: 860px) {
  /* Above the tab bar, the pager and the reading pull-up at rest (132 px), and the home indicator. */
  .owner-fb { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .dialog.owner-note { margin-top: var(--s2); padding: var(--s4); }
  .owner-note__actions .btn { flex: 1 1 auto; }
}
