*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Reserve scrollbar space so layout does not shift when it appears */
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

@media (max-width: 960px) {
  html {
    scrollbar-gutter: auto;
  }

  @supports not (scrollbar-gutter: stable) {
    html {
      overflow-y: auto;
    }
  }

  body {
    padding-inline-end: env(safe-area-inset-right, 0);
  }

  a,
  button,
  input,
  select,
  textarea,
  label,
  summary,
  [role="button"],
  [tabindex]:not([tabindex="-1"]) {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--md-sys-color-on-background);
  background-color: var(--md-sys-color-background);
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  font-size: 24px;
  line-height: 1;
  user-select: none;
}

/* M3 filled button */
.btn-filled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: "Lato", system-ui, sans-serif;
  font-size: var(--type-button-size);
  font-weight: 500;
  letter-spacing: var(--type-button-letter-spacing);
  line-height: var(--type-button-line-height);
  text-decoration: none;
  cursor: pointer;
  color: var(--md-sys-color-on-primary);
  background-color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-1);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-filled:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* M3 icon button */
a.btn-icon,
button.btn-icon {
  font: inherit;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--md-sys-shape-corner-large);
  text-decoration: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  background-color: transparent;
  transition:
    background-color 0.2s ease,
    border-radius 0.2s ease;
}

.btn-icon:active:not(:disabled) {
  border-radius: var(--md-sys-shape-corner-full);
}

.btn-icon:hover:not(:disabled) {
  background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.btn-icon:disabled,
.btn-icon:disabled:hover,
.btn-icon:disabled:active {
  pointer-events: none;
  cursor: default;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.38;
  background-color: transparent;
  border-radius: var(--md-sys-shape-corner-large);
}

.btn-icon:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.btn-filled:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: var(--md-sys-elevation-2);
}

.btn-filled:disabled,
.btn-filled:disabled:hover {
  pointer-events: none;
  cursor: default;
  filter: none;
  box-shadow: var(--md-sys-elevation-1);
  opacity: 0.38;
}

/* M3 filled tonal button */
.btn-tonal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  width: 48px;
  min-height: 40px;
  min-width: 48px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-family: "Lato", system-ui, sans-serif;
  font-size: var(--type-button-size);
  font-weight: 500;
  letter-spacing: var(--type-button-letter-spacing);
  line-height: var(--type-button-line-height);
  text-decoration: none;
  cursor: pointer;
  color: var(--md-sys-color-on-secondary-container);
  background-color: var(--md-sys-color-secondary-container);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.btn-tonal:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.btn-tonal:hover:not(:disabled) {
  filter: brightness(0.97);
  box-shadow: var(--md-sys-elevation-1);
}

.btn-tonal:disabled,
.btn-tonal:disabled:hover {
  pointer-events: none;
  cursor: default;
  filter: none;
  box-shadow: none;
  opacity: 0.38;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
