/* Общие правила рабочих форм. Детальные таблицы сохраняют собственную широкую область. */
html { scrollbar-gutter: stable; }
/* Фиксированный масштаб сенсорного интерфейса; прокрутка по обеим осям остаётся доступной. */
@media (hover: none) and (pointer: coarse) {
  html, body { touch-action: pan-x pan-y; }
  /* Мелкие поля вызывают автоматическое приближение при фокусе в Safari. */
  body input:not([type=checkbox]):not([type=radio]), body select, body textarea { font-size: max(16px, 1em) !important; }
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
main.form-page { max-width: 876px; }
main.form-page > form, main.form-page > form > .card { width: 100%; max-width: none; }
main.form-page fieldset { min-width: 0; }
.form-actions { position: sticky; bottom: 12px; z-index: 22; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); box-shadow: 0 4px 18px #0002; }
.save-state { color: var(--muted); font-size: 13px; margin-left: auto; align-self: center; }
.error-summary { border: 2px solid var(--danger); padding: 12px 16px; margin: 12px 0; border-radius: 10px; background: var(--card); }
.error-summary a { color: var(--danger); }
.error-summary ul { margin: 6px 0 0; padding-left: 20px; }
.section-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.section-links a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
[id] { scroll-margin-top: calc(var(--header-h, 48px) + 16px); }
body .page-tabs { scrollbar-width: thin; padding-bottom: 5px; }
body .page-tabs::-webkit-scrollbar { display: block; height: 6px; }
.tabs-hint { display: block; font-size: 12px; color: var(--muted); margin: -8px 0 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.contact-row { min-width: 0; }
.contact-tools { display: flex; justify-content: flex-end; margin-top: 8px; }
.contact-tools label { margin: 0; }
body .task .moves button { min-width: 44px; min-height: 44px; padding: 8px 12px; }
body .status-chip.cancelled { background: #fde2e1; color: #7a271a; }
body .g-zone .full, body .g-people .full, body .g-zone .full small { background: #fee4e2; color: #7a271a; }
.table-scroll .gantt { overflow: visible; }
.gantt .g-row .label { position: sticky; left: 0; z-index: 3; }
.schedule-scroll { max-height: 72vh; overflow: auto; }
.schedule-scroll .g-head { position: sticky; top: 0; z-index: 5; background: var(--card); }
body .nm th:first-child, body .nm td.name { position: sticky; left: 0; z-index: 2; background: var(--card); box-shadow: 1px 0 var(--line); }
body .nm tr.new td.name { background: var(--bg); }
.nm-mobile-toggle { display: none; }
.post-stage { padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--card); }
@media (max-width: 899px) {
  .form-actions { bottom: calc(68px + env(safe-area-inset-bottom)); padding: 8px; }
  .form-actions button { min-height: 44px; }
  .save-state { flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 600px) {
  body .nm input, body .nm select { font-size: 16px; }
  .nm-mobile-toggle { display: inline-block; margin: 0 0 8px; }
  .nm-form[data-mobile-cards] table.nm, .nm-form[data-mobile-cards] .nm tbody,
  .nm-form[data-mobile-cards] .nm tr { display: block; }
  .nm-form[data-mobile-cards] .nm tr { padding: 12px; border-bottom: 2px solid var(--line); }
  .nm-form[data-mobile-cards] .nm tr:has(th) { display: none; }
  .nm-form[data-mobile-cards] .nm td { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 6px;
    width: auto; min-width: 0; padding: 8px 0; position: static; box-shadow: none; }
  .nm-form[data-mobile-cards] .nm td::before { content: attr(data-label); font-weight: 600; align-self: center; }
  .nm-form[data-mobile-cards] .nm td.name { display: block; }
  .nm-form[data-mobile-cards] .nm td.name::before { display: block; margin-bottom: 4px; }
  .nm-form[data-mobile-cards] .nm td input, .nm-form[data-mobile-cards] .nm td select { width: 100%; min-width: 0; }
  .nm-form[data-mobile-cards] .nm td input[type=checkbox] { width: 20px; height: 20px; }
  .nm-form[data-mobile-cards] .nm .error { grid-column: 1 / -1; }
}
@media print { .form-actions { position: static; box-shadow: none; } .section-links, .tabs-hint { display: none; } }
