/* Round 1: shared typography, spacing and controls.
   Keep the existing palette, font families and page structure. */
:root {
  --ui-title-size: 30px;
  --ui-section-size: 22px;
  --ui-dialog-size: 23px;
  --ui-label-size: 16px;
  --ui-help-size: 13px;
  --ui-control-height: 44px;
  --ui-field-height: 48px;
  --ui-field-radius: 9px;
  --ui-gap-small: 8px;
  --ui-gap-medium: 16px;
  --ui-gap-large: 24px;
  --ui-gap-section: 32px;
}

/* Align equivalent headings without changing the greeting or brand type. */
.ux-heading h1,
.ux-area-heading h1,
.page-heading h1,
.ep-category-title,
.taxonomy-page header h1 {
  font-size: var(--ui-title-size);
  font-weight: 600;
  line-height: 1.45;
}
.ep-section-heading h2,
.section-head h2,
.ux-area h2,
.ux-results-heading h2,
.taxonomy-page h2 {
  font-size: var(--ui-section-size);
  font-weight: 600;
  line-height: 1.5;
}
.modal-head h2,
.ux-editor .modal-head h2 {
  font-size: var(--ui-dialog-size);
  line-height: 1.5;
}

/* Preserve module order and columns; use a steadier vertical rhythm. */
.ep-content { padding-top: 40px; }
.ep-greeting { margin-bottom: var(--ui-gap-section); }
.ep-categories,
.ep-add-sections,
.ep-resources { margin-top: 36px; }
.ep-section-heading { margin-bottom: var(--ui-gap-medium); }
.ux-area-heading { margin-bottom: var(--ui-gap-large); }
.ep-task-card > p { line-height: 1.7; }
.ep-category-card strong { white-space: normal; overflow-wrap: anywhere; }
.ux-tile-copy strong,
.ux-tile-copy small,
.ux-record-copy small { overflow-wrap: anywhere; }
.ux-record-copy small { line-height: 1.7; }

/* Make shared navigation targets easier to reach, retaining their positions. */
.ep-side-group { padding-top: 22px; padding-bottom: 18px; }
.ep-side-group h2 { margin-bottom: var(--ui-gap-small); }
.ep-side-group button,
.ep-side-tools button {
  min-height: var(--ui-control-height);
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.6;
}
.ep-side-group button span,
.ep-side-tools button span { min-width: 0; }
.ep-sidebar .story-side-entry,
.ux-record-tabs button { min-height: var(--ui-control-height); }
.rec-carousel .rec-toolbar > button {
  min-width: var(--ui-control-height);
  min-height: var(--ui-control-height);
}

/* Keep filled, outlined and text actions visually distinct through existing colors. */
.ep-main .button,
.modal .button {
  min-height: var(--ui-control-height);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 550;
  gap: var(--ui-gap-small);
}
.modal-footer .button,
.ux-editor .modal-footer .button { min-height: var(--ui-control-height); }
.modal-head .icon-btn {
  min-width: var(--ui-control-height);
  min-height: var(--ui-control-height);
}
.modal-head h2 { padding-right: 48px; overflow-wrap: anywhere; }

/* Keep file controls, radios and checkboxes at their existing native dimensions. */
.modal-body .field { min-width: 0; }
.modal .field > label {
  font-size: var(--ui-label-size);
  line-height: 1.6;
  margin-bottom: var(--ui-gap-small);
}
.modal .field input:is(:not([type]), [type="text"], [type="email"], [type="password"], [type="tel"], [type="number"], [type="url"], [type="search"], [type="date"], [type="time"], [type="datetime-local"]),
.modal .field select,
.modal .field textarea {
  font-size: var(--ui-label-size);
  line-height: 1.6;
  min-height: var(--ui-field-height);
  padding: 12px 14px;
  border-radius: var(--ui-field-radius);
  box-sizing: border-box;
  max-width: 100%;
}
.modal .field textarea { min-height: 110px; }
.modal .field small,
.modal .dialog-note,
.modal .plain-hint {
  font-size: var(--ui-help-size);
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.modal .field input::placeholder,
.modal .field textarea::placeholder { font-size: 14px; }

@media (max-width: 800px) {
  :root {
    --ui-title-size: 27px;
    --ui-section-size: 21px;
    --ui-dialog-size: 22px;
  }
  .ep-content { padding-top: var(--ui-gap-large); }
  .ep-greeting { margin-bottom: 28px; }
  .ep-categories,
  .ep-add-sections,
  .ep-resources { margin-top: var(--ui-gap-section); }
  .rec-carousel .rec-toolbar { gap: 4px; }
  .ux-heading > div { min-width: 0; }
  .modal-footer .button { white-space: normal; overflow-wrap: anywhere; }
}
