/* Keep workspace pages and action forms aligned with the sidebar at browser zoom. */
:root { --app-sidebar-width: 220px; }
.sidebar {
  width: var(--app-sidebar-width);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.sidebar > * { flex-shrink: 0; min-width: 0; }
.sidebar .sidebar-spacer { flex: 1 0 16px; }
.sidebar .brand > div:last-child { min-width: 0; }
.sidebar .brand strong, .sidebar .brand span { white-space: normal; overflow-wrap: anywhere; }
.sidebar .brand-mark, .sidebar .avatar { flex-shrink: 0; }
.sidebar button { max-width: 100%; }
.workspace { margin-left: var(--app-sidebar-width); min-width: 0; }
.topbar > *, main, .view, .card { min-width: 0; }
.topbar .search { min-width: 0; max-width: 100%; }

:is(.task-modal,.expense-modal,.change-modal,.money-modal,.ec-modal,.dl-modal,.pt-modal,.security-center) {
  inset: 0 0 0 var(--app-sidebar-width) !important;
  padding: clamp(12px, 2vw, 32px) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  align-items: start !important;
}
:is(.task-modal-panel,.expense-modal-panel,.change-modal-panel,.money-modal-panel,.ec-modal-panel,.dl-modal-panel,.pt-modal-panel,.security-panel) {
  width: min(1180px, 100%) !important;
  min-width: 0;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(16px, 2vw, 28px) !important;
  overflow-wrap: anywhere;
}
.task-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:is(.task-modal-panel,.expense-modal-panel,.change-modal-panel,.money-modal-panel,.ec-modal-panel,.dl-modal-panel,.pt-modal-panel) label { min-width: 0; }
:is(.task-modal-panel,.expense-modal-panel,.change-modal-panel,.money-modal-panel,.ec-modal-panel,.dl-modal-panel,.pt-modal-panel) :is(input,select,textarea) { min-width: 0; max-width: 100%; }
:is(.task-modal-head,.task-modal-actions,.expense-modal-head,.change-modal-head) { gap: 12px; flex-wrap: wrap; }
.task-modal-head > button { flex-shrink: 0; }
.task-modal-actions button { height: auto; min-height: 44px; white-space: normal; padding: 10px 16px; }
/* Readable form typography at normal browser zoom. */
body :is(.task-modal-panel,.expense-modal-panel,.change-modal-panel,.money-modal-panel,.ec-modal-panel,.dl-modal-panel,.pt-modal-panel) label {
  font-size: 14px !important;
  line-height: 1.5 !important;
  margin-top: 16px;
}
body :is(.task-modal-panel,.expense-modal-panel,.change-modal-panel,.money-modal-panel,.ec-modal-panel,.dl-modal-panel,.pt-modal-panel) :is(input,select,textarea) {
  font-size: 16px !important;
  line-height: 1.5 !important;
  min-height: 48px;
  padding: 12px !important;
  margin-top: 6px;
}
body :is(.task-modal-panel,.expense-modal-panel,.change-modal-panel,.money-modal-panel,.ec-modal-panel,.dl-modal-panel,.pt-modal-panel) button {
  font-size: 16px !important;
  line-height: 1.5 !important;
}
body .task-modal-head h3 { font-size: 26px !important; line-height: 1.25; }
body .task-modal-head .eyebrow { font-size: 14px !important; line-height: 1.5; }
body .task-modal-head > button { font-size: 22px !important; }
.task-form-grid { column-gap: 20px; }
.task-modal-actions { margin-top: 24px; }
@media (max-width: 1050px) { :root { --app-sidebar-width: 78px; } }
@media (max-width: 720px) {
  :root { --app-sidebar-width: 0px; }
  .task-form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head, .project-tools { flex-wrap: wrap; }
  .project-search { min-width: 0; width: 100%; }
}
@media (max-width: 420px) {
  .task-modal-actions { flex-direction: column-reverse; align-items: stretch; }
  .task-modal-actions button { width: 100%; }
}

/* Explicit task return control stays visible at every viewport size. */
body .task-modal-head > button.task-return {
  width: auto; height: auto; margin: 0;
  font-size: 16px !important; white-space: normal;
}
