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

html[data-text-size="large"] {
  font-size: 112.5%;
}

.site-header .global-nav {
  margin-left: auto;
}

.header-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.text-size-toggle {
  position: relative;
  z-index: 40;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  color: inherit;
  border: 1px solid rgba(23, 54, 74, 0.24);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.74);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.text-size-toggle-label::before {
  content: "文字を大きく";
}

.text-size-toggle[aria-pressed="true"] .text-size-toggle-label::before {
  content: "標準に戻す";
}

.site-header:not(.is-scrolled) .text-size-toggle {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(4, 24, 38, 0.2);
  backdrop-filter: blur(10px);
}

.site-header .text-size-toggle:hover,
.site-header .text-size-toggle:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49, 93, 84, 0.14);
  outline: none;
}

.site-header:not(.is-scrolled) .text-size-toggle:hover,
.site-header:not(.is-scrolled) .text-size-toggle:focus-visible,
.site-header:not(.is-scrolled) .text-size-toggle[aria-pressed="true"] {
  color: #102c40;
  border-color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.94);
}

.site-header.is-scrolled .text-size-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.header-controls .back-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

html[data-text-size="large"] .header-inner,
html[data-text-size="large"] .global-nav {
  gap: 18px;
}

.glass-description {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(0, 1fr);
  gap: 7px 18px;
  align-items: baseline;
  width: min(660px, 100%);
  padding: 14px 17px;
  border: 1px solid rgba(220, 244, 241, 0.22);
  border-left: 3px solid rgba(220, 244, 241, 0.86);
  background: rgba(4, 24, 38, 0.27);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(12px);
}

.glass-description strong {
  color: #fff;
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-size: 0.94rem;
  letter-spacing: 0.03em;
}

.glass-description span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  line-height: 1.75;
}

.glass-selector button[aria-pressed="true"] {
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(220, 244, 241, 0.28);
}

.work-mobile-controls button[aria-pressed="true"],
.work-mobile-controls button.is-active {
  box-shadow: 0 0 0 3px rgba(49, 93, 84, 0.18);
}

@media (max-width: 980px) {
  .global-nav {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px !important;
    color: var(--white);
    background: var(--navy);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .global-nav.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .global-nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 22px;
    color: var(--white) !important;
    font-size: 1.05rem;
  }

  .menu-button {
    position: relative;
    z-index: 40;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    color: var(--navy);
    border: 1px solid var(--line);
    background: var(--white);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
  }

  .site-header:not(.is-scrolled) .menu-button {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.45);
    background: transparent;
  }

  .menu-button[aria-expanded="true"] {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.45);
    background: transparent;
  }

  body.menu-open .text-size-toggle {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 620px) {
  .header-inner {
    gap: 8px;
  }

  .brand,
  .brand-copy {
    min-width: 0;
  }

  .header-controls {
    gap: 6px;
  }

  .text-size-toggle,
  .menu-button,
  .header-controls .back-link {
    min-height: 48px !important;
  }

  .text-size-toggle {
    min-width: 48px;
    padding: 7px 9px;
  }

  .text-size-toggle-label::before {
    content: "文字";
  }

  .text-size-toggle[aria-pressed="true"] .text-size-toggle-label::before {
    content: "標準";
  }

  .header-controls .back-link {
    padding-inline: 4px;
  }

  .glass-selector-label {
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  .glass-selector button {
    min-height: 48px;
    padding: 10px 13px;
    font-size: 0.78rem;
    font-weight: 700;
  }

  .glass-description {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 15px;
  }

  .glass-description strong {
    font-size: 0.98rem;
  }

  .glass-description span {
    font-size: 0.84rem;
  }

  .hero-next-event-label {
    font-size: 0.78rem;
  }

  .calendar-control {
    min-width: 48px !important;
    min-height: 48px !important;
    padding-inline: 10px !important;
  }

  .calendar-day {
    min-height: 96px !important;
  }

  .calendar-event {
    min-height: 48px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 6px 5px !important;
    font-size: 0.64rem !important;
  }

  .agenda-item {
    width: 100%;
    min-height: 48px;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .report-link,
  .work-page-nav a,
  .work-mobile-controls button,
  .link-list a {
    min-height: 48px;
  }

  .report-link,
  .link-list a {
    display: inline-flex;
    align-items: center;
  }

  .link-list a {
    width: 100%;
  }

  .work-mobile-controls button {
    font-size: 0.82rem;
  }

  html[data-text-size="large"] .brand small {
    display: none;
  }

  html[data-text-size="large"] .brand strong {
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .text-size-toggle,
  .global-nav {
    transition: none;
  }
}
