/* Small shared refinements. Keep the existing layouts and motion choreography. */
html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}
html:has(.nova-navigation) {
  scroll-padding-top: 82px;
}
/* Native modal focus trapping does not itself prevent the page from scrolling. */
@media screen {
  html:has(dialog:modal) {
    overflow: hidden;
  }
}
dialog {
  overscroll-behavior: contain;
}
button,
a,
summary {
  touch-action: manipulation;
}
summary {
  cursor: pointer;
}
summary:focus-visible {
  outline: 2px solid #3674b5;
  outline-offset: 4px;
  border-radius: 8px;
}
.site-header a,
.site-footer a,
.legal-page a {
  text-underline-offset: 0.22em;
}
.legal-page h1,
.legal-page h2,
.experience-hero h1,
.start-welcome h1 {
  text-wrap: balance;
}
.section-head p,
.community-empty p,
.empty p {
  text-wrap: pretty;
}
.finance-kpi strong,
.finance-mobile-card dd,
.finance-table td,
.activity-ring-label strong,
.day-number {
  font-variant-numeric: tabular-nums;
}
.learning-dialog > header > div,
.thread-heading > div {
  min-width: 0;
}
.learning-dialog > header h2,
.community-dialog h2 {
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.learning-dialog > header > button {
  flex-shrink: 0;
}
.compact-rings .activity-orbit {
  width: 100%;
}
.activity-legend,
.activity-legend > div {
  min-width: 0;
}
.activity-legend span {
  overflow-wrap: anywhere;
}
.nova-lightbox::backdrop {
  background: #101217b8;
  backdrop-filter: blur(6px);
}
.nova-lightbox button {
  min-width: 44px;
  min-height: 44px;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}
.nova-lightbox figcaption {
  line-height: 1.55;
  text-wrap: pretty;
}
.nova-assistant > header button,
.header-sign-in,
.auth-close {
  min-width: 44px;
  min-height: 44px;
}
.assistant-attach,
.assistant-send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.assistant-composer > div > span {
  line-height: 1.5;
}
/* Feedback stays quiet, with no lift on non-interactive cards or disabled actions. */
@media (hover: hover) and (pointer: fine) {
  .nova-lightbox button:hover {
    background: #ffffff2b;
    border-color: #ffffff60;
  }
  .next-step:hover {
    border-color: #bcc7d4;
    box-shadow: 0 6px 18px #1d29390d;
  }
  .course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px #27365210;
  }
  button:disabled:hover {
    transform: none;
    box-shadow: none;
  }
}
@media screen and (max-width: 900px) {
  /* 16px prevents focus zoom in iOS without disabling pinch-to-zoom. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea {
    font-size: 16px !important;
  }
  .top-actions button,
  .calendar-actions button,
  .calendar-view-controls button,
  .learning-dialog > header > button,
  .auth-text-button,
  .auth-password-toggle {
    min-height: 44px;
  }
  .learning-dialog {
    max-height: calc(100dvh - 32px);
    scroll-padding-block: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nova-lightbox button {
    transition: none;
  }
}

/* Page headings share the content edge, including when their actions wrap. */
#messagesRoot > .section-head,
#profileRoot > .section-head {
  text-align: left;
  align-items: flex-start;
  width: 100%;
}
.section-head h1 {
  line-height: 1.12;
}
#messagesRoot > .section-head > :first-child,
#profileRoot > .section-head > :first-child {
  flex: 1;
  min-width: 0;
}
#environmentBanner > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#environmentBanner #returnOrganisation {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
}
.mobile-controls {
  display: contents;
}
.assistant-action-icon {
  display: none;
}
@media screen and (max-width: 900px) {
  .mobile-controls {
    position: fixed;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(440px, calc(100% - 24px));
    left: 50%;
    bottom: max(14px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 100;
    transition: width 360ms var(--nova-ease);
  }
  .auth-locked .mobile-controls {
    display: none;
  }
  .mobile-controls:has(.mobile-dock.is-compact) {
    width: 126px;
  }
  .mobile-controls .mobile-dock,
  .mobile-controls .mobile-dock.is-compact {
    position: relative;
    inset: auto;
    transform: none;
    flex: 1;
    width: 0;
    min-width: 0;
    padding-inline: 4px;
    gap: 0;
  }
  .mobile-controls .dock-button {
    min-width: 0;
    padding-inline: 1px;
    white-space: nowrap;
  }
  .mobile-controls .nova-assistant-launch {
    position: relative;
    inset: auto;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 15px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fafaffeb;
    backdrop-filter: blur(9px) saturate(0.85);
    -webkit-backdrop-filter: blur(9px) saturate(0.85);
  }
  .mobile-controls .nova-assistant-launch img,
  .mobile-controls .nova-assistant-launch span {
    display: none;
  }
  .mobile-controls .assistant-action-icon {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}
@media screen and (max-width: 700px) {
  #messagesRoot > .section-head,
  #profileRoot > .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    padding-inline: 22px;
    gap: 18px;
  }
  #messagesRoot > .section-head > .community-actions {
    width: 100%;
    flex-wrap: nowrap;
    gap: 10px;
  }
  #messagesRoot > .section-head .community-actions button {
    width: auto;
    min-height: 44px;
    margin: 0;
  }
  #messagesRoot > .section-head [data-compose] {
    flex: 1;
  }
  #environmentBanner {
    gap: 10px;
  }
  #environmentBanner #returnOrganisation {
    padding: 8px 10px;
    font-size: 11px;
  }
}
/* A quiet highlighter stroke draws attention to a few learning phrases. */
.nova-highlight {
  color: inherit;
  background: linear-gradient(#dcebf5, #dcebf5) no-repeat 0 84% / 100% 62%;
  padding: 0 0.055em;
  margin-inline: -0.055em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.nova-highlight.highlight-warm {
  background-image: linear-gradient(#f6e8af, #f6e8af);
}
@media (prefers-reduced-motion: no-preference) {
  .nova-highlight.highlight-pending {
    background-size: 0% 62%;
  }
  .nova-highlight.highlight-drawn {
    animation: nova-highlight-draw 850ms cubic-bezier(0.22, 0.75, 0.25, 1) both;
  }
}
@keyframes nova-highlight-draw {
  from {
    background-size: 0% 62%;
  }
  to {
    background-size: 100% 62%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-controls {
    transition: none;
  }
}
