/* StudyTickApp global density pass — shared by every published HTML page.
   Only reduce redundant whitespace. Never hide content, shift fixed overlays,
   collapse editable note surfaces, or shrink keyboard/touch controls. */
@media screen {
  :root {
    --st-compact-page-gap: clamp(10px, 1.5vw, 16px);
    --st-compact-card-pad: clamp(12px, 1.7vw, 20px);
    --st-compact-section-gap: clamp(12px, 2vw, 22px);
  }

  /* Shared page/section rhythm, including public Help and information pages. */
  html body:not(.focus-view) > main {
    padding-block-end: clamp(22px, 3vw, 38px);
  }
  html body:not(.focus-view) > main > :is(section, article) + :is(section, article) {
    margin-block-start: var(--st-compact-section-gap);
  }
  html body .st-site-footer {
    margin-block: 12px max(12px, env(safe-area-inset-bottom, 0px));
    padding-block: 9px;
  }
  html body .st-site-footer-inner { row-gap: 5px; }

  /* Dashboard: retain card hierarchy while removing excess gutters. */
  html[data-theme] body.today-dashboard-preview:not(.focus-view) main#main {
    padding-block-start: 0;
    padding-block-end: 24px;
    padding-inline: clamp(12px, 2vw, 24px);
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .today-signature {
    gap: var(--st-compact-page-gap);
    row-gap: var(--st-compact-page-gap);
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .today-signature-head {
    padding: var(--st-compact-card-pad);
    gap: 10px;
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view)
    :is(.today-progress-card, .today-timeline-card, .today-quick-actions, .today-dashboard-planning-buttons, .schedule) {
    padding: var(--st-compact-card-pad);
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .layout {
    gap: var(--st-compact-page-gap);
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view)
    :is(.today-manage-heading, .schedule-head, .today-timeline-header) {
    gap: 8px;
    margin-block-end: 8px;
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .today-timeline-item {
    min-height: 0;
    padding-block: 7px;
    gap: 8px;
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .today-quick-actions {
    row-gap: 8px;
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .weekly-day-strip {
    gap: 5px;
  }
  html[data-theme] body.today-dashboard-preview:not(.focus-view) .planner-card {
    min-height: 0;
    padding: 8px 11px;
    gap: 8px;
  }
  html[data-theme] body.st-timetable-header-open #stHeaderViewHost {
    margin-block: 10px 18px;
  }
  html[data-theme] body.today-dashboard-preview > header.st-refined {
    padding-block: 9px 8px;
    gap: 7px;
  }

  /* Daily Summary: keep four clear metrics and roomy-enough expandable rows. */
  html body #stEodWidget .st-eod-body { padding-top: 7px; }
  html body #stEodWidget .st-eod-reveal {
    gap: 9px;
    margin-block: 2px 12px;
    padding: clamp(11px, 1.6vw, 16px);
  }
  html body #stEodWidget .st-eod-headline-metrics { gap: 7px; }
  html body #stEodWidget .st-eod-headline-metrics .st-eod-reveal-stat {
    min-height: 0;
    padding: 9px;
  }
  html body #stEodWidget .st-eod-section > summary,
  html body #stEodWidget .st-eod-advanced > summary {
    padding: 9px 12px;
    min-height: 44px;
  }
  html body #stEodWidget .st-eod-report :is(h3,h4) {
    margin-block: 10px 5px;
  }
  html body #stEodWidget .st-eod-metrics { margin-block: 8px; }
  html body #stEodWidget form.st-eod-preferences {
    padding: 11px;
    gap: 8px;
    margin-block: 8px 12px;
  }

  /* Group Timer: reduce lobby and room whitespace, not the countdown or sand animation. */
  html[data-theme] body.group-timer-page .group-wrap {
    padding-block: 10px 24px;
    padding-inline: clamp(12px, 2vw, 24px);
  }
  html[data-theme] body.group-timer-page .group-page-intro-row {
    gap: 8px;
    padding-block-end: 7px;
    margin-block-end: 8px;
  }
  html[data-theme] body.group-timer-page .group-intro { margin-block-end: 8px; }
  html[data-theme] body.group-timer-page .group-intro h1 { margin-block-end: 5px; }
  html[data-theme] body.group-timer-page :is(.group-setup,.group-columns,.group-side) {
    gap: 9px;
  }
  html[data-theme] body.group-timer-page .group-room-heading {
    margin-block-end: 9px;
    gap: 8px;
  }
  html[data-theme] body.group-timer-page #groupRoom .group-clock-card {
    padding: 12px 13px !important;
  }
  html[data-theme] body.group-timer-page #groupRoom .group-collab-card {
    padding: 12px !important;
  }
  html[data-theme] body.group-timer-page :is(.group-muted,.group-small) {
    margin-block-end: 8px;
  }
  html[data-theme] body.group-timer-page .group-controls { gap: 7px; }

  /* TickNotes: less framing; never shrink writable lines or calendar day buttons. */
  html[data-theme] body.ticknotes-page .ticknotes-site-header {
    padding-block: 9px;
    gap: 8px;
  }
  html[data-theme] body.ticknotes-page .ticknotes-main {
    padding: 12px clamp(12px, 2vw, 24px) 28px;
  }
  html[data-theme] body.ticknotes-page .ticknotes-overview {
    gap: 10px;
    margin-block-end: 10px;
    padding: clamp(12px, 1.7vw, 19px);
  }
  html[data-theme] body.ticknotes-page .ticknotes-overview h1 { margin-block-end: 3px; }
  html[data-theme] body.ticknotes-page .ticknotes-controls {
    padding: 10px 12px;
    gap: 8px;
    margin-block-end: 10px;
  }
  html[data-theme] body.ticknotes-page .tick-calendar {
    padding: 10px;
    margin-block-end: 12px;
  }
  html[data-theme] body.ticknotes-page .tick-paper {
    padding: clamp(14px, 2vw, 24px);
  }
  html[data-theme] body.ticknotes-page .tick-paper-columns {
    gap: clamp(12px, 2vw, 26px);
  }
  html[data-theme] body.ticknotes-page .tick-paper-section {
    margin-block-end: 15px;
  }
  html[data-theme] body.ticknotes-page .tick-paper-title {
    gap: 12px;
    padding-block-end: 9px;
    margin-block-end: 11px;
  }
  html[data-theme] body.ticknotes-page .tick-paper-week { margin-block: 9px 13px; }

  /* Prayer and personal rituals: shorter intro and lighter card framing. */
  html[data-theme] body.prayer-reminders-page .pr-shell {
    padding: 12px clamp(12px, 2vw, 20px) 28px;
  }
  html[data-theme] body.prayer-reminders-page .pr-top { margin-block-end: 12px; }
  html[data-theme] body.prayer-reminders-page .pr-hero { margin-block-end: 12px; }
  html[data-theme] body.prayer-reminders-page .pr-hero h1 { margin-block: 5px; }
  html[data-theme] body.prayer-reminders-page .pr-card {
    padding: var(--st-compact-card-pad);
  }
  html[data-theme] body.prayer-reminders-page .pr-card-heading { margin-block-end: 11px; }

  /* Account access: keep form readable, reduce empty space above and below. */
  html body .login-copy { padding: clamp(24px, 3.6vw, 56px) clamp(18px, 3vw, 48px); }
  html body .login-panel { padding-block: 20px 18px; }
  html body .login-heading { margin-block-end: 17px; }
  html body .login-heading p { margin-block-start: 8px; }
  html body .login-footer { margin-block-start: 16px; }

  /* Public landing, feature pages and knowledge articles. */
  html[data-theme] body:has(>main#content>.hero) #content {
    padding-inline: clamp(12px, 2vw, 24px);
    padding-block-end: 28px;
  }
  html[data-theme] body:has(>main#content>.hero) #content > header {
    padding-block: 9px 12px;
  }
  html[data-theme] body:has(>main#content>.hero) .hero {
    padding: clamp(18px, 3vw, 32px);
    margin-block: 10px 20px;
  }
  html[data-theme] body:has(>main#content>.hero) .hero .actions {
    gap: 8px;
    margin-block: 14px 7px;
  }
  html[data-theme] body:has(>main#content>.hero) .tools { gap: 11px; }
  html[data-theme] body:has(>main#content>.hero)
    :is(.tools .card, #content > section.card) {
    padding: clamp(12px, 1.7vw, 19px);
    margin-block: 9px;
  }
  html[data-theme] body:has(>main#content>.hero) #content > .hero + section > h2 {
    margin-block-end: 13px;
  }

  @media (max-width: 700px) {
    html[data-theme] body.today-dashboard-preview:not(.focus-view) main#main {
      padding-inline: 10px;
      padding-block-end: 18px;
    }
    html[data-theme] body.today-dashboard-preview:not(.focus-view) .today-signature {
      gap: 9px;
    }
    html[data-theme] body.today-dashboard-preview:not(.focus-view) .today-signature-head {
      padding: 11px;
    }
    html[data-theme] body.group-timer-page .group-wrap {
      padding: 9px max(10px, env(safe-area-inset-right, 0px)) 20px;
    }
    html[data-theme] body.ticknotes-page .ticknotes-main {
      padding: 10px 10px 22px;
    }
    html[data-theme] body.ticknotes-page .tick-paper {
      padding: 14px 12px;
    }
    html[data-theme] body.ticknotes-page .tick-paper-columns { gap: 0; }
    html[data-theme] body.prayer-reminders-page .pr-card { padding: 13px; }
    html[data-theme] body:has(>main#content>.hero) .hero {
      padding: 16px;
      margin-block: 8px 15px;
    }
  }
}
/* Normal print spacing is unchanged: document and note export remain readable. */
