/* StudyTickApp — quiet, accessible design tokens.
 * Presentation only: do not alter timer, schedule, auth, or collaboration state.
 * Avoid broad position/display overrides so active study sessions remain stable.
 */
:root {
  --st-space-1: 8px;
  --st-space-2: 16px;
  --st-space-3: 24px;
  --st-space-4: 32px;
  --st-control-height: 44px;
  --st-control-radius: 12px;
  --st-control-icon: 18px;
  --st-motion-duration: 180ms;
  --st-motion-ease: cubic-bezier(.2,.7,.25,1);
  --st-control-ring: var(--sc-accent-strong, #176b51);
}
html[data-theme="dark"] {
  --st-control-ring: #a4efce;
}

/* Editorial headlines remain Playfair, but tasks, labels and controls use Inter.
 * Locale-specific font fallbacks are supplied by typography.css.
 */
html body {
  font-family: var(--st-body, Inter, system-ui, sans-serif);
}
html body :is(h1, h2, .today-greeting, .group-room-heading h2) {
  font-family: var(--st-heading, "Playfair Display", Georgia, serif) !important;
  line-height: 1.25;
  text-wrap: balance;
}
html body :is(h3, h4, h5, h6, button, input, textarea, select, label,
  .today-timeline-task, .today-timeline-target, .today-section-label,
  .group-kicker, .social-rank-row, .ticknotes-main) {
  font-family: var(--st-body, Inter, system-ui, sans-serif) !important;
}
html body :is(p, li, label, small) {
  line-height: 1.5;
}
html body :is(h1, h2, h3, h4, p, .today-timeline-task, .group-room-heading) {
  overflow-wrap: break-word;
}

/* Shared control rhythm. Icon-only, close and drag handles keep their own layout. */
html body :is(button, [role="button"], .st-nav-action) {
  min-height: var(--st-control-height);
  border-radius: var(--st-control-radius);
  -webkit-tap-highlight-color: transparent;
}
html body :is(.st-toolbar, .today-manage-actions, .st-start-actions, .group-controls,
  .group-install-actions, .social-action-pair, .group-social-nav, .st-eod-actions)
  :is(button, a) {
  min-height: var(--st-control-height);
  border-radius: var(--st-control-radius);
  font-family: var(--st-body, Inter, system-ui, sans-serif) !important;
}
html body :is(.st-toolbar, .today-manage-actions, .group-controls, .group-social-nav)
  :is(button, a) > svg:not(.st-brand-mark) {
  width: var(--st-control-icon);
  height: var(--st-control-icon);
  flex: 0 0 var(--st-control-icon);
}
html body :is(button, [role="button"], .st-toolbar a, .group-social-nav-btn,
  .group-back, .ticknotes-back-link) {
  transition: background-color var(--st-motion-duration) var(--st-motion-ease),
    border-color var(--st-motion-duration) var(--st-motion-ease),
    color var(--st-motion-duration) var(--st-motion-ease),
    box-shadow var(--st-motion-duration) var(--st-motion-ease),
    filter var(--st-motion-duration) var(--st-motion-ease);
}
html body :is(button, [role="button"]):disabled {
  cursor: not-allowed;
}
html body :is(a, button, input, select, textarea, summary, [role="button"]):focus-visible {
  outline: 3px solid var(--st-control-ring) !important;
  outline-offset: 3px !important;
}
@media (hover: hover) and (pointer: fine) {
  html body:not(.low-stimulation):not(.low-stimulation-mode)
    :is(.st-toolbar, .today-manage-actions, .st-start-actions,
      .group-controls, .group-social-nav, .group-install-actions)
    :is(button, a):not(:disabled):not([aria-disabled="true"]):hover {
    filter: brightness(.97);
  }
}

/* Eight-pixel spacing scale; do not reposition or hide navigation or timer internals. */
html body :is(.today-manage-actions, .st-start-actions, .group-controls,
  .group-install-actions, .social-action-pair) {
  column-gap: var(--st-space-2);
  row-gap: var(--st-space-1);
}
html body :is(.today-progress-card, .today-timeline-card,
  .group-clock-card, .group-setup, .social-section, .ticknotes-main) {
  min-width: 0;
}
html body :is(.today-signature, .today-exam, .today-timeline-card,
  .today-progress-card, .group-setup, .group-clock-card, .social-section) {
  scroll-margin-block-start: var(--st-space-3);
}
html body :is(.today-timeline-item, .group-message, .social-message,
  .social-rank-row, .ticknotes-main) {
  overflow-wrap: anywhere;
}

/* Subtle ring depth, preserving the progress arc and 67:33 brand artwork. */
html body:not(.low-stimulation):not(.low-stimulation-mode)
  :is(.chime-focus-ring, .group-timer-ring, .group-clock-ring) {
  filter: drop-shadow(0 0 9px rgba(79, 160, 126, .10));
}
html[data-theme="dark"] body:not(.low-stimulation):not(.low-stimulation-mode)
  :is(.chime-focus-ring, .group-timer-ring, .group-clock-ring) {
  filter: drop-shadow(0 0 9px rgba(164, 239, 206, .13));
}

/* Phone layouts: accommodate translated text without sideways scrolling. */
@media (max-width: 700px) {
  html body :is(main, section, article, .layout, .today-signature,
    .today-progress-card, .today-timeline-card, .group-wrap, .group-columns,
    .group-clock-card, .group-setup, .ticknotes-main) {
    min-width: 0;
    max-width: 100%;
  }
  html body :is(.today-signature-head, .today-manage-actions,
    .st-start-actions, .group-controls, .group-install-actions,
    .social-action-pair) {
    flex-wrap: wrap;
  }
  html body :is(.today-manage-actions, .st-start-actions,
    .group-controls, .group-install-actions) > * {
    min-width: 0;
  }
  html body :is(input:not([type="checkbox"]):not([type="radio"]),
    select, textarea) {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  html body :is(.today-timeline-actions, .group-controls, .social-action-pair) {
    row-gap: var(--st-space-1);
  }
  html body :is(h1, .today-greeting) {
    font-size: clamp(1.6rem, 6vw, 2.35rem);
    overflow-wrap: break-word;
  }
  html body :is(.group-controls, .today-manage-actions, .st-toolbar)
    :is(button, a) {
    touch-action: manipulation;
  }
}
@media (max-width: 390px) {
  html body :is(.group-controls, .group-install-actions, .social-action-pair) > button {
    max-width: 100%;
    white-space: normal;
  }
  html body :is(.group-intro, .today-timeline-item) {
    min-width: 0;
  }
}

/* Honor accessibility and StudyTick's explicit Low Stimulation setting. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  html body :is(button, [role="button"], .st-toolbar a, .group-social-nav-btn,
    .group-back, .ticknotes-back-link, .chime-focus-ring,
    .group-timer-ring, .group-clock-ring) {
    transition: none !important;
    animation: none !important;
  }
  html body :is(.chime-focus-ring, .group-timer-ring, .group-clock-ring) {
    filter: none !important;
  }
}
html body:is(.low-stimulation, .low-stimulation-mode, [data-low-stimulation="true"])
  :is(button, [role="button"], .chime-focus-ring,
    .group-timer-ring, .group-clock-ring) {
  transition: none !important;
  filter: none !important;
}
@media (forced-colors: active) {
  html body :is(button, a, input, textarea, select, summary):focus-visible {
    outline-color: Highlight !important;
  }
}