/* Shared phone and tablet ergonomics. Kept separate from each product's theme. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, canvas { max-width: 100%; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
.owner-filters > summary { list-style: none; }
.owner-filters > summary::-webkit-details-marker { display: none; }
.owner-filters-chevron { display: inline-block; transition: transform 150ms; }
.owner-filters[open] .owner-filters-chevron { transform: rotate(180deg); }
.owner-dashboard .payment-status-paid { color: #065f46; background: #d1fae5; }
[data-theme="dark"] .owner-dashboard .payment-status-paid { color: #6ee7b7; background: rgb(16 185 129 / 14%); }

@media (max-width: 1023px) {
  .app-topbar { gap: 4px; padding-right: 12px; padding-left: 12px; }
  .app-topbar button { min-height: 44px; min-width: 44px; flex-shrink: 0; }
  .app-topbar .app-notification-panel { top: calc(4.5rem + env(safe-area-inset-top)); }
  .app-topbar .app-notification-list { max-height: min(24rem, calc(100dvh - 13rem)); overscroll-behavior: contain; }
  .app-mobile-nav { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .app-mobile-nav > a { min-height: 60px; }
  .app-help-button { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app-sidebar { max-width: calc(100vw - 44px); height: 100dvh; overscroll-behavior: contain; }
  .app-task-panel { max-height: 100dvh; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
  .app-task-panel button { min-height: 40px; }
  .app-task-panel > div:first-child button { min-width: 44px; min-height: 44px; }
  .owner-dashboard { min-width: 0; }
  .owner-dashboard .btn-primary, .owner-dashboard .btn-ghost { min-height: 44px; }
  .owner-dashboard summary { min-height: 44px; }
  .owner-dashboard input:not([type="hidden"]), .owner-dashboard select, .owner-dashboard textarea { min-height: 44px; }
  .owner-dashboard textarea { min-height: 88px; }
  .owner-dashboard [data-complaint] button { min-height: 44px; }
  .owner-dashboard [data-complaint] code { overflow-wrap: anywhere; }
}

@media (max-width: 767px) {
  .btn-primary, .btn-ghost { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]),
  select, textarea { font-size: 16px !important; max-width: 100%; min-width: 0; }
  input[type="date"], input[type="time"], input[type="datetime-local"], select { min-height: 44px; }
  main { min-width: 0; }
  .md-preview, .prose-lessio, .blog-prose { overflow-wrap: anywhere; }
  .md-preview table, .prose-lessio table, .blog-prose table { display: block; max-width: 100%; overflow-x: auto; }
  .md-preview pre, .prose-lessio pre, .blog-prose pre { max-width: 100%; overflow-x: auto; }
  .owner-dashboard > div:first-child { margin-bottom: 20px; }
  .owner-dashboard #billing > .card { padding: 14px; }
  .owner-dashboard [data-complaint] { padding: 14px; }
  .task-row { flex-wrap: wrap; gap: 6px; padding: 12px; }
  .task-row .task-title { order: -1; flex: 1 1 100%; flex-wrap: wrap; overflow: visible; }
  .task-title > button {
    order: -1; flex: 1 1 100%; min-height: 40px; white-space: normal;
    overflow-wrap: anywhere; line-height: 1.5; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .task-row .task-selection { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 40px; }
  .task-row .task-subtasks { width: 40px; height: 40px; }
  .task-row .task-complete { width: 36px; height: 36px; }
  .task-row .task-actions { width: 44px; height: 44px; opacity: 1; margin-left: auto; }
  .task-row button[title="Изменить дату"] { min-height: 40px; }
}

@media (hover: none) and (max-width: 1023px) {
  body:has(input:not([type="checkbox"]):not([type="radio"]):not([type="date"]):not([type="time"]):not([type="datetime-local"]):not([type="range"]):not([type="color"]):focus, textarea:focus) .app-mobile-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .owner-filters-chevron { transition: none; }
}
