/* Reset, typography and page layout. Element selectors are allowed only in homline_ui. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--hl-page);
  color: var(--hl-text);
  font-family: var(--hl-font-ui);
  font-weight: var(--hl-weight-regular);
  line-height: var(--hl-line-height);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--hl-space-3);
  font-weight: var(--hl-weight-bold);
  line-height: var(--hl-line-height-tight);
}

h1 {
  font-size: var(--hl-text-2xl);
}

h2 {
  font-size: var(--hl-text-xl);
}

h3 {
  font-size: var(--hl-text-lg);
}

p {
  margin: 0 0 var(--hl-space-3);
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: var(--hl-focus-width) solid var(--hl-focus);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
}

/* Density tokens apply wherever a layout is declared (body, or a style guide preview). */
[data-hl-layout] {
  font-size: var(--hl-font-size-base);
}

/* Elements hidden with the attribute stay hidden even when a class sets their
   display (doubled to outrank one class, without !important). */
[hidden][hidden] {
  display: none;
}

/* Layout shell */
.hl-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hl-space-4);
  min-height: var(--hl-header-height);
  padding: var(--hl-space-2) var(--hl-space-4);
  background: var(--hl-brand);
  color: var(--hl-brand-ink);
}

.hl-header__brand {
  font-family: var(--hl-font-display);
  font-weight: var(--hl-weight-display);
  font-variant-numeric: lining-nums;
  text-transform: uppercase;
  letter-spacing: var(--hl-letter-spacing-caps);
  text-decoration: none;
  white-space: nowrap;
}

.hl-header__logo {
  height: calc(var(--hl-header-height) - var(--hl-space-4));
  width: auto;
}

.hl-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hl-space-1) var(--hl-space-4);
  margin-left: auto;
}

.hl-header__link {
  display: inline-flex;
  align-items: center;
  gap: var(--hl-space-2);
  min-height: var(--hl-touch-target);
  text-decoration: none;
}

/* Who is signed in, and the way out, on every screen. */
.hl-header__account {
  display: flex;
  align-items: center;
  gap: var(--hl-space-3);
  margin-left: auto;
}

.hl-header:has(.hl-header__nav) .hl-header__account {
  margin-left: 0;
}

.hl-header__user {
  font-size: var(--hl-text-sm);
  opacity: 0.85;
}

.hl-header__button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* People with several screens (TPRC, coordinators) get a screen switcher. */
.hl-header:has(.hl-header__nav--screens) .hl-header__nav:not(.hl-header__nav--screens) {
  margin-left: 0;
}

.hl-header__nav:empty {
  display: none;
}

.hl-header__link[aria-current="page"] {
  text-decoration: underline;
}

.hl-main {
  width: 100%;
  max-width: var(--hl-content-width);
  margin: 0 auto;
  padding: var(--hl-gap) var(--hl-space-4);
}

.hl-main--narrow {
  max-width: var(--hl-content-width-narrow);
}

.hl-main--auth {
  padding-top: var(--hl-space-6);
}

.hl-main--auth h1 {
  margin-bottom: var(--hl-space-1);
}

.hl-main--auth p {
  margin: 0;
}

.hl-main--full {
  max-width: none;
}

.hl-footer {
  padding: var(--hl-space-4);
  color: var(--hl-text-muted);
  font-size: var(--hl-text-xs);
  text-align: center;
}

.hl-skip-link {
  position: absolute;
  left: var(--hl-space-2);
  top: calc(-1 * var(--hl-header-height));
  padding: var(--hl-space-2) var(--hl-space-3);
  background: var(--hl-card);
  color: var(--hl-text);
}

.hl-skip-link:focus {
  top: var(--hl-space-2);
}

/* Layout helpers, so modules never need their own spacing CSS. */
.hl-stack {
  display: flex;
  flex-direction: column;
  gap: var(--hl-gap);
}

/* A quiet link button ("Back to the week") keeps its own width. */
.hl-stack > .hl-button--quiet:not(.hl-button--block) {
  align-self: flex-start;
}

.hl-stack > :is(h2, h3):not(:first-child) {
  margin-top: var(--hl-space-4);
}

.hl-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hl-space-3);
}

.hl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--hl-gap);
}

.hl-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Typography helpers */
.hl-display {
  font-family: var(--hl-font-display);
  font-size: var(--hl-text-display);
  font-weight: var(--hl-weight-display);
  font-variant-numeric: lining-nums;
  text-transform: uppercase;
  line-height: var(--hl-line-height-tight);
}

.hl-muted {
  color: var(--hl-text-muted);
}

/* Stays in view while the page scrolls (e.g. steps waiting to be sent). */
.hl-sticky {
  position: sticky;
  top: var(--hl-space-2);
  z-index: 1;
}

.hl-center {
  text-align: center;
}

.hl-label {
  font-size: var(--hl-text-xs);
  font-weight: var(--hl-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--hl-letter-spacing-caps);
}

/* Quantities, times and amounts: aligned, equal-width figures (spec 3.5). */
.hl-num {
  font-family: var(--hl-font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.hl-num--big {
  font-size: var(--hl-text-2xl);
  font-weight: var(--hl-weight-bold);
}
