/* App styles only: colours through the GUI kit's --m-* tokens (all themes). The shared look (header, side navigation,
   cards, tabs, tables, animated buttons, the devkit modules' helpers) is devkit/shell/shell.css: do not copy it here. */
#app-data-alert { margin-bottom: 14px; }
/* offline badge and "new version": in a corner, the phone's header has no room for them */
.app-status { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; display: flex; gap: 8px; align-items: center; }
.app-status > [hidden] { display: none; }
.app-status > .m-badge { background: var(--m-bg-solid); pointer-events: none; }
@media print { .app-status { display: none; } }
.app-import-errors { overflow-wrap: anywhere; margin-top: 8px; }

/* lists home and list view */
.app-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.app-actions--top { margin: 12px 0 16px; }
.app-section { margin-bottom: 20px; }
.app-section > .app-h { margin-bottom: 10px; }
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; align-items: start; }
.app-list-card .app-face, .app-group-card .app-face { overflow-wrap: anywhere; }
.app-cards > .app-flip:has(.app-tagpop:not([hidden])) { position: relative; z-index: 5; }
.app-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.app-note { margin: 10px 0 0; }
.app-listtags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.app-item-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.app-about { margin: 10px 0; }
.app-about > * + * { margin-top: 8px; }
.app-section + .app-tiles { margin-top: 4px; }
/* the tag button at the right edge of a row: its tooltip opens inwards, or the page would scroll sideways */
.app-titem .app-tagpop-btn[data-tip]::after { left: auto; right: 0; transform: translateY(4px); }
.app-titem .app-tagpop-btn[data-tip]:is(:hover, :focus-visible, .is-tip)::after { transform: none; }

/* tick view: the title and progress stay at the top of the scrolling main area (its padding is taken back) */
.app-tick { max-width: 760px; }
.app-tickbar { position: sticky; top: -20px; z-index: 6; margin-inline: -8px; padding: 10px 8px 8px; border-radius: 0 0 var(--m-r) var(--m-r); background: color-mix(in srgb, var(--m-bg-solid) 86%, transparent); backdrop-filter: blur(10px); }
.app-progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.app-progress > strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-tick .app-note, .app-tick .app-meta { margin: 8px 0; }
.app-tickctl { justify-content: space-between; margin: 8px 0 4px; }
.app-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.app-switch.app-switch > .m-switch.m-switch { height: 24px; min-height: 24px; }
.app-tview-body { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.app-tview > summary { gap: 8px; min-height: 44px; }
.app-tgroups { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.app-tgroup > summary { min-height: 48px; }
.app-tgroup-name { min-width: 0; overflow-wrap: anywhere; }
.app-tgroup > .m-collapse-body { padding: 2px 8px 8px; }
.app-titems { margin-bottom: 8px; }
.app-titem.app-titem { gap: 4px; padding: 2px 4px; }
.app-titem > .m-reorder-handle { min-height: 44px; }
.app-tcheck { flex: 1; min-width: 0; min-height: 44px; gap: 6px; padding: 4px; -webkit-touch-callout: none; user-select: none; }
.app-tcheck.app-tcheck > .m-checkbox { flex: none; width: 22px; min-width: 22px; height: 22px; min-height: 22px; }
.app-tcheck > .m-checkbox:checked::after { top: 4px; left: 7px; }
.app-titem.is-done .app-item-text { text-decoration: line-through; color: var(--m-text-3); }
.app-tick .app-add > .m-btn { min-width: 44px; min-height: 44px; }
.app-tick .app-add > .m-input { min-height: 44px; }
.app-tick.is-big .app-item-text { font-size: 20px; line-height: 1.35; }
.app-tick.is-big .app-tgroup > summary { font-size: 17px; }
.app-tick.is-big .app-tcheck { min-height: 56px; }
.app-tick.is-big .app-tcheck.app-tcheck > .m-checkbox { width: 28px; min-width: 28px; height: 28px; min-height: 28px; }
.app-tick.is-big .app-tcheck > .m-checkbox:checked::after { top: 5px; left: 9px; width: 6px; height: 12px; }
@media (pointer: coarse) {
  .app-titem.app-titem > .m-reorder-handle, .app-gorder.app-gorder .m-reorder-handle, .app-titem > .m-btn--icon, .app-gorder .m-btn--icon { min-width: 44px; min-height: 44px; }
}
@media (max-width: 860px) { .app-tickbar { top: -16px; } }

/* board mode (my-gui board): the columns use the page's width */
.app-tick.is-board { max-width: none; }
.app-mode { margin: 8px 0 0; }
.app-bcard .m-board-body { display: flex; align-items: center; gap: 4px; }
/* relative: the hidden text (.app-sr) must not escape the board's sideways scroller and widen the page */
.app-bcheck { position: relative; flex: none; justify-content: center; min-width: 32px; min-height: 32px; gap: 0; }
.app-bcheck.app-bcheck > .m-checkbox { flex: none; width: 22px; min-width: 22px; height: 22px; min-height: 22px; }
.app-bcheck > .m-checkbox:checked::after { top: 4px; left: 7px; }
.app-btext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.app-btext > .app-meta { display: flex; margin: 4px 0 0; }
.app-bcard.is-done .app-item-text { text-decoration: line-through; color: var(--m-text-3); }
.app-tick.is-big .app-bcheck.app-bcheck > .m-checkbox { width: 28px; min-width: 28px; height: 28px; min-height: 28px; }
.app-tick.is-big .app-bcheck > .m-checkbox:checked::after { top: 5px; left: 9px; width: 6px; height: 12px; }
.app-board .app-add > .m-input { min-height: 44px; }
.app-board .app-add > .m-btn { min-width: 44px; min-height: 44px; }
@media (pointer: coarse) {
  .app-bcheck { min-width: 40px; min-height: 44px; }
  /* a tap on the card's text opens it: the pencil gives its room to the text, but stays for screen readers and the keyboard */
  .app-bcard .m-board-body > .m-btn--icon:not(:focus-visible) { position: absolute; width: 1px; min-width: 0; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .app-bcard .m-board-body { position: relative; min-height: 44px; }
}
@media screen and (max-width: 600px) { .app-board { --m-board-col: 90%; } }

/* edit view */
.app-edit { max-width: 760px; }
.app-fields { margin: 0; padding: 0; border: 0; min-width: 0; }
.app-etitle { margin: 12px 0; }
.app-metaform { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 20px; }
.app-egroups { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 16px; }
.app-egroup { padding: 10px; min-width: 0; }
.app-ehead, .app-add { display: flex; align-items: center; gap: 6px; }
.app-ehead > .m-input, .app-add > .m-input, .app-eitem > .app-itext { flex: 1 1 0%; width: 0; min-width: 0; }
.app-ehead > .app-h-ico, .app-ehead > .m-btn, .app-add > .m-btn { flex: none; }
.app-ehead > .m-input { font-weight: 700; }
.app-eitems { margin: 10px 0; }
.app-edit textarea.app-itext { min-height: 0; padding-block: 8px; line-height: 1.35; }
.app-edit .app-actions { margin: 8px 0; }
.app-eitem.app-eitem { flex-wrap: wrap; gap: 4px; padding: 4px; }
.app-etools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 0 100%; padding-inline-start: 32px; }
.app-etools[hidden] { display: none; }
.app-moveto { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.app-moveto > .m-combo { flex: 1; min-width: 0; }
.app-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-gorder { margin-bottom: 12px; }
.app-section > .app-actions { margin-bottom: 10px; }
@media (pointer: coarse) {
  .app-edit .m-reorder-handle, .app-gorder .m-reorder-handle { min-width: 40px; min-height: 44px; }
  .app-edit .m-btn, .app-edit .m-input { min-height: 44px; }
  .app-edit textarea.app-itext { padding-block: 12px; }
  .app-edit .m-btn--icon { min-width: 40px; }
}
@media (max-width: 480px) {
  .app-ehead { flex-wrap: wrap; justify-content: flex-end; }
  .app-ehead > .m-input { width: calc(100% - 48px); flex: 1 1 calc(100% - 48px); }
}
