/* r5 (John 24 Nov 6:35 PM JST). On top of r3.css. Phone r4.1 rules (no sideways scroll at <=600px, title width, pinned
   header) are untouched; nothing here changes the desktop or tablet look of a resting list. */

/* P3-10: the Add box is a wrapping text area (app.js fitQuickAdd sets its height, padding and line height). One line looks
   like the old field: the form keeps its min-height (the old row height) and the text sits centred in it; extra lines
   grow the row a line at a time. The + stays level with the first line. */
form.quick-add.qa-task { height: auto !important; align-items: flex-start; }
form.quick-add.qa-task .plus { display: flex; align-items: center; justify-content: center; height: var(--qa-h, 100%); align-self: flex-start; }
form.quick-add.qa-task textarea { display: block; flex: 1 1 auto; min-width: 0; min-height: 0 !important; margin: 0; border: 0; border-radius: 0; background: transparent;
  resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; -webkit-appearance: none; appearance: none; scrollbar-width: none; }
form.quick-add.qa-task textarea:focus { outline: none; }
form.quick-add.qa-task.multi { padding-bottom: 0; }

/* P3-10: the inline name editor wraps too (one line = the old height; longer names grow the row while editing) */
.task textarea.title-input { white-space: pre-wrap !important; overflow-wrap: anywhere; text-overflow: clip !important; resize: none; overflow: hidden; scrollbar-width: none; padding: 0; }
.task.title-multi { height: auto !important; align-items: start; }
.task.title-multi .title-line { align-items: flex-start; }
@media (max-width: 899px) { /* phone rows are fixed-height grid rows: while a long name is edited the row grows with it */
  main.grid .pt-inner .task.title-multi { height: auto !important; }
  main.grid .pt-inner .task.title-multi > .first { height: auto; align-items: flex-start; }
  main.grid .pt-inner .task.title-multi .title-line { height: auto; min-height: var(--pt-row); align-items: flex-start; padding: calc((var(--pt-row) - 44px) / 2) 0; }
  main.grid .pt-inner .task.title-multi .title-line > textarea.title { flex: 1 1 auto; }
}

/* Kirby design OK (24 Nov), phone fix 1: touch screens have no hover. A tap leaves :hover (and :focus) on the menu row under
   the finger, which drew a sticky gray highlight at rest (e.g. 'Create follow-up task' in the press-and-hold sheet). No hover
   or tap-focus fill on menu and sheet rows there; the pressed (:active) fill stays. The keyboard ring (:focus-visible) stays. */
@media (hover: none) {
  .ctx-item:hover, .ctx-item:focus:not(:focus-visible), .ctx-item.danger:hover, .ctx-item.danger:focus:not(:focus-visible) { background: none; }
  .ctx-item:hover .ctx-ic, .ctx-item:focus:not(:focus-visible) .ctx-ic { color: var(--text-2); }
  .ctx-item.danger:hover .ctx-ic, .ctx-item.danger:focus:not(:focus-visible) .ctx-ic { color: var(--danger); }
  .ctx-item:active:not(:disabled) { background: var(--hover); }
  .ctx-item.danger:active:not(:disabled) { background: var(--error-bg); }
}

/* Kirby design OK (24 Nov), phone fix 2, revised for r6 (Kirby's r6 OK): the Add box text and its focus underline end where
   the name editor of the new row ends, inside the title column (x=305 at 390: pin 318 less the editor's 13px inset), not
   16px from the screen edge. */
@media (max-width: 600px) {
  form.quick-add.qa-task textarea { margin-right: calc(var(--pt-w, 100vw) - var(--pt-pin) + 13px); }
}
