/*
 * AlphaBloom lower-page design system
 * Loaded last on non-front pages so legacy styles cannot override it.
 */

:root {
  --ab-ink: #0c0d12;
  --ab-muted: #656b78;
  --ab-line: #e4e7ee;
  --ab-surface: #f5f7fb;
  --ab-blue: #315fe5;
  --ab-blue-dark: #182466;
  --ab-radius-lg: 32px;
  --ab-radius-md: 22px;
  --ab-shadow: 0 20px 60px rgba(17, 27, 68, 0.08);
}

body:not(.home) {
  margin: 0;
  color: var(--ab-ink);
  background: #fff;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/*
 * Safety net for content section headings. Legacy versions of the theme used
 * the bare `header` element for the fixed sidebar; a section heading must
 * never inherit that layout.
 */
body:not(.home) .ab-lower-main header {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  background: transparent !important;
  color: inherit !important;
  z-index: auto !important;
}

/* Never allow the front-page opening layer or legacy side layout on subpages. */
html.is-opening-pending body:not(.home) {
  overflow-y: auto !important;
}

html.is-opening-pending body:not(.home) > :not(.site_opening) {
  visibility: visible !important;
}

body:not(.home) .site_opening,
body:not(.home) .site_opening_movie,
body:not(.home) .opening_movie,
body:not(.home) .opening_logo {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body:not(.home) main,
body:not(.home) footer {
  width: 100% !important;
  margin-left: 0 !important;
}

body:not(.home) *,
body:not(.home) *::before,
body:not(.home) *::after {
  box-sizing: border-box;
}

body:not(.home) img,
body:not(.home) iframe {
  max-width: 100%;
}

body:not(.home) main {
  display: block;
  padding-top: 72px;
  overflow: hidden;
}

body:not(.home) a {
  color: inherit;
}

/* Shared header: match the front page instead of the legacy lower-page header. */
body:not(.home) #header.site_header {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  z-index: 1000 !important;
  width: 100% !important;
  height: 72px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid rgba(18, 22, 38, 0.08) !important;
  box-shadow: 0 8px 30px rgba(16, 24, 48, 0.04) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  bottom: auto !important;
  overflow: visible !important;
  color: var(--ab-ink) !important;
}

body:not(.home).admin-bar #header.site_header {
  top: 32px !important;
}

body:not(.home) #header .site_header_inner {
  display: flex !important;
  align-items: center !important;
  width: calc(100% - 48px) !important;
  max-width: 1200px !important;
  height: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
}

body:not(.home) #header .site_brand {
  display: flex !important;
  flex: 0 0 148px !important;
  align-items: center !important;
  width: 148px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:not(.home) #header .site_brand_logo {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
}

body:not(.home) #header .site_nav {
  display: block !important;
  width: auto !important;
  margin: 0 22px 0 auto !important;
  padding: 0 !important;
}

body:not(.home) #header .site_nav ul {
  display: flex !important;
  align-items: center !important;
  gap: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body:not(.home) #header .site_nav li {
  margin: 0 !important;
  padding: 0 !important;
}

body:not(.home) #header .site_nav a {
  display: block !important;
  padding: 8px 0 !important;
  color: #17191f !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.01em !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

body:not(.home) #header .site_nav a:hover {
  opacity: 0.55;
}

body:not(.home) #header .site_header_cta {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 126px !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 22px !important;
  color: #fff !important;
  background: var(--ab-ink) !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

body:not(.home) #header .site_header_cta:hover {
  color: #fff !important;
  background: #2f5be3 !important;
}

body:not(.home) #header .sp_nav {
  display: none !important;
}

/* Shared lower-page foundations. */
.ab-lower-main {
  min-height: 60vh;
  background: #fff;
}

.ab-lower-shell {
  width: min(1120px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.ab-page-hero {
  position: relative;
  padding: 100px 0 64px;
  background:
    radial-gradient(circle at 82% 12%, rgba(74, 111, 239, 0.14), transparent 36%),
    linear-gradient(135deg, #fafbff 0%, #f2f5fd 100%);
}

.ab-page-hero h1 {
  margin: 0 !important;
  color: var(--ab-ink) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: clamp(40px, 6vw, 68px) !important;
  font-weight: 800 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.055em !important;
}

.ab-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 22px;
  padding-bottom: 22px;
  color: #8a909d;
  border-bottom: 1px solid var(--ab-line);
  font-size: 12px;
  font-weight: 600;
}

.ab-breadcrumb a {
  color: var(--ab-blue);
  text-decoration: none;
}

.ab-section-heading {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 64px;
  align-items: end;
  margin-bottom: 52px;
}

.ab-section-heading h2 {
  margin: 0 !important;
  color: var(--ab-ink) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: clamp(30px, 4vw, 48px) !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  letter-spacing: -0.045em !important;
}

.ab-section-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--ab-muted);
  font-size: 15px;
  line-height: 2;
}

.ab-about-section,
.ab-contact-section {
  padding: 104px 0;
}

.ab-about-section--soft {
  background: var(--ab-surface);
}

/* About page. */
.ab-message-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 72px;
  align-items: stretch;
}

.ab-message-copy,
.ab-profile-card,
.ab-history-list,
.ab-company-list,
.ab-access-card {
  background: #fff;
  border: 1px solid rgba(20, 30, 65, 0.08);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-message-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 66px);
}

.ab-message-copy p {
  margin: 0 0 1.45em;
  color: #313642;
  font-size: 15px;
  line-height: 2.15;
}

.ab-message-copy p:last-of-type {
  margin-bottom: 0;
}

.ab-message-signature {
  margin-top: 38px !important;
  color: var(--ab-ink) !important;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.8 !important;
}

.ab-message-signature strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.ab-message-photo {
  min-height: 610px;
  overflow: hidden;
  background: #e9edf7;
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-message-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ab-profile-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: clamp(30px, 5vw, 56px);
}

.ab-profile-name span {
  display: block;
  margin-bottom: 12px;
  color: var(--ab-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ab-profile-name strong {
  display: block;
  font-size: 30px;
  line-height: 1.4;
}

.ab-profile-bio {
  margin: 0;
  color: #3f4551;
  font-size: 15px;
  line-height: 2.15;
}

.ab-history-list {
  margin: 0;
  padding: 12px clamp(24px, 4vw, 50px);
  list-style: none;
}

.ab-history-list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 28px;
  padding: 25px 0;
  border-bottom: 1px solid var(--ab-line);
}

.ab-history-list li:last-child {
  border-bottom: 0;
}

.ab-history-year {
  color: var(--ab-blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ab-history-text {
  color: #313641;
  font-size: 14px;
  line-height: 1.9;
}

.ab-company-list {
  margin: 0;
  padding: 12px clamp(24px, 4vw, 50px);
}

.ab-company-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 32px;
  padding: 25px 0;
  border-bottom: 1px solid var(--ab-line);
}

.ab-company-row:last-child {
  border-bottom: 0;
}

.ab-company-row dt,
.ab-company-row dd {
  margin: 0;
}

.ab-company-row dt {
  color: #686f7d;
  font-size: 13px;
  font-weight: 700;
}

.ab-company-row dd {
  color: var(--ab-ink);
  font-size: 14px;
  line-height: 1.9;
}

.ab-access-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 28px;
}

.ab-access-card {
  padding: 38px;
}

.ab-access-card h3 {
  margin: 0 0 18px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.ab-access-card p {
  margin: 0;
  color: var(--ab-muted);
  font-size: 14px;
  line-height: 2;
}

.ab-access-map {
  min-height: 420px;
  overflow: hidden;
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-access-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
}

/* Contact page. */
.ab-contact-intro {
  max-width: 700px;
  margin: 0 auto 44px;
  color: var(--ab-muted);
  font-size: 15px;
  line-height: 2;
  text-align: center;
}

.ab-contact-card {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px);
  background: #fff;
  border: 1px solid rgba(20, 30, 65, 0.08);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-contact-card h2 {
  margin: 0 0 44px !important;
  color: var(--ab-ink) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: clamp(28px, 4vw, 42px) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.04em !important;
  text-align: center;
}

.ab-contact-form {
  display: grid;
  gap: 0;
}

.ab-form-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 25px 0;
  border-bottom: 1px solid var(--ab-line);
}

.ab-form-label {
  padding-top: 13px;
  color: var(--ab-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.ab-required,
.ab-optional {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 1px;
}

.ab-required {
  color: #b22645;
  background: #fce9ee;
}

.ab-optional {
  color: #697181;
  background: #eef0f4;
}

.ab-contact-form input[type="text"],
.ab-contact-form input[type="email"],
.ab-contact-form input[type="tel"],
.ab-contact-form textarea,
.ab-contact-form select {
  display: block;
  width: 100% !important;
  max-width: none !important;
  min-height: 52px;
  margin: 0 !important;
  padding: 13px 16px !important;
  color: var(--ab-ink) !important;
  background: #f7f8fb !important;
  border: 1px solid #dfe3eb !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  appearance: none;
}

.ab-contact-form textarea {
  min-height: 200px;
  resize: vertical;
}

.ab-contact-form input:focus,
.ab-contact-form textarea:focus,
.ab-contact-form select:focus {
  outline: 3px solid rgba(49, 95, 229, 0.14) !important;
  border-color: var(--ab-blue) !important;
}

.ab-consent-box {
  margin-top: 30px;
  padding: 24px;
  background: var(--ab-surface);
  border-radius: 16px;
  text-align: center;
}

.ab-consent-box label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.ab-consent-box input {
  width: 20px;
  height: 20px;
}

.ab-form-submit {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.ab-form-submit button,
.ab-submit-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 240px !important;
  min-height: 58px !important;
  padding: 0 30px !important;
  color: #fff !important;
  background: var(--ab-blue) !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  cursor: pointer;
}

.ab-form-submit button:hover,
.ab-submit-button:hover {
  background: var(--ab-blue-dark) !important;
  transform: translateY(-2px);
}

.ab-form-message {
  margin: 0 auto 28px;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
}

.ab-form-message--success {
  color: #12623b;
  background: #e9f8ef;
}

.ab-form-message--error {
  color: #9d2440;
  background: #fdecef;
}

/* WordPress-managed articles and archives. */
body:not(.home) .ab-article-head,
body:not(.home) .ab-entry-content,
body:not(.home) .ab-single-wrap,
body:not(.home) .ab-archive-wrap,
body:not(.home) .ab-card-grid {
  font-family: "Noto Sans JP", sans-serif !important;
}

body:not(.home) .ab-article-head h1,
body:not(.home) .ab-entry-content h1,
body:not(.home) .ab-entry-content h2,
body:not(.home) .ab-entry-content h3,
body:not(.home) .ab-entry-content h4,
body:not(.home) .ab-card-title,
body:not(.home) .post_title,
body:not(.home) .entry-title {
  font-family: "Noto Sans JP", sans-serif !important;
  font-style: normal !important;
}

body:not(.home) .ab-entry-content {
  color: #303541;
  font-size: 16px;
  line-height: 2;
}

body:not(.home) .ab-entry-content h2 {
  margin: 2.2em 0 0.8em;
  padding-bottom: 0.45em;
  border-bottom: 1px solid var(--ab-line);
  color: var(--ab-ink);
  font-size: clamp(25px, 3.5vw, 34px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.035em;
}

body:not(.home) .ab-entry-content h3 {
  margin: 1.9em 0 0.7em;
  color: var(--ab-ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
}

body:not(.home) .ab-entry-content img {
  height: auto;
  border-radius: 20px;
}

body:not(.home) .ab-back-link {
  display: flex !important;
  width: 100% !important;
  margin: 56px auto 0 !important;
  padding: 0 !important;
  justify-content: center !important;
  text-align: center !important;
}

body:not(.home) .ab-back-link a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 48px;
  padding: 0 22px;
  color: var(--ab-ink) !important;
  background: #fff;
  border: 1px solid #d9dde6;
  border-radius: 999px;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}

body:not(.home) .ab-back-link a:hover {
  color: #fff !important;
  background: var(--ab-ink);
  border-color: var(--ab-ink);
}

/* Improve legacy lower templates that have not yet been migrated. */
body:not(.home) .lower_page_ttl_bg {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 96px 0 58px !important;
  background:
    radial-gradient(circle at 82% 12%, rgba(74, 111, 239, 0.14), transparent 36%),
    linear-gradient(135deg, #fafbff 0%, #f2f5fd 100%) !important;
}

body:not(.home) .lower_page_ttl_bg h1,
body:not(.home) .lower_page_ttl,
body:not(.home) .lower_section_ttl,
body:not(.home) .section_ttl {
  color: var(--ab-ink) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-style: normal !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
}

body:not(.home) .lower_page_ttl_bg h1,
body:not(.home) .lower_page_ttl {
  font-size: clamp(40px, 6vw, 68px) !important;
  line-height: 1.1 !important;
}

body:not(.home) .pankuzu,
body:not(.home) .breadcrumb {
  width: min(1120px, calc(100% - 48px)) !important;
  margin: 0 auto !important;
  padding: 22px 0 !important;
  color: #8a909d !important;
  border-bottom: 1px solid var(--ab-line);
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 12px !important;
}

body:not(.home) .section_inner,
body:not(.home) .wrap_r:not(.site_header_inner):not(.footer_inner) {
  width: min(1120px, calc(100% - 48px)) !important;
  max-width: 1120px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

body:not(.home) .policy_wrap,
body:not(.home) .service_link_box,
body:not(.home) .service_explain,
body:not(.home) .service_faq {
  overflow: hidden;
  background: #fff !important;
  border: 1px solid var(--ab-line) !important;
  border-radius: var(--ab-radius-md) !important;
  box-shadow: var(--ab-shadow) !important;
}

/* Footer consistency. */
body:not(.home) .site-footer {
  margin: 0 !important;
  padding: 70px 0 28px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  background: #0c0d12 !important;
  border: 0 !important;
  font-family: "Noto Sans JP", sans-serif !important;
}

body:not(.home) .site-footer .footer_inner {
  width: min(1120px, calc(100% - 48px)) !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body:not(.home) .site-footer a {
  color: inherit !important;
  text-decoration: none !important;
}

@media (max-width: 960px) {
  body:not(.home) #header .site_nav ul {
    gap: 18px !important;
  }

  body:not(.home) #header .site_nav a {
    font-size: 13px !important;
  }

  .ab-message-grid {
    grid-template-columns: 1fr 0.72fr;
    gap: 32px;
  }

  .ab-profile-card {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 820px) {
  body:not(.home) main {
    padding-top: 64px;
  }

  body:not(.home) #header.site_header {
    height: 64px !important;
  }

  body:not(.home).admin-bar #header.site_header {
    top: 46px !important;
  }

  body:not(.home) #header .site_header_inner {
    width: calc(100% - 32px) !important;
  }

  body:not(.home) #header .site_brand {
    flex-basis: 132px !important;
    width: 132px !important;
  }

  body:not(.home) #header .site_nav,
  body:not(.home) #header .site_header_cta {
    display: none !important;
  }

  body:not(.home) #header .sp_nav {
    display: block !important;
    margin: 0 0 0 auto !important;
  }

  body:not(.home) #header .hamburger {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: flex !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 1px solid #dfe2e8 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
  }

  body:not(.home) #header .hamburger span {
    position: absolute !important;
    left: 12px !important;
    display: block !important;
    width: 18px !important;
    height: 1px !important;
    margin: 0 !important;
    background: var(--ab-ink) !important;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  body:not(.home) #header .hamburger span:nth-child(1) { transform: translateY(-5px); }
  body:not(.home) #header .hamburger span:nth-child(2) { transform: translateY(0); }
  body:not(.home) #header .hamburger span:nth-child(3) { transform: translateY(5px); }

  body:not(.home) #header .hamburger.active span:nth-child(1) { transform: rotate(45deg); }
  body:not(.home) #header .hamburger.active span:nth-child(2) { opacity: 0; }
  body:not(.home) #header .hamburger.active span:nth-child(3) { transform: rotate(-45deg); }

  body:not(.home) #header .globalMenuSp.site_mobile_menu {
    position: fixed !important;
    top: 76px !important;
    right: 16px !important;
    left: 16px !important;
    z-index: 1001 !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 20px !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid var(--ab-line) !important;
    border-radius: 20px !important;
    box-shadow: 0 24px 70px rgba(14, 22, 52, 0.2) !important;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }

  body:not(.home).admin-bar #header .globalMenuSp.site_mobile_menu {
    top: 122px !important;
  }

  body:not(.home) #header .globalMenuSp.site_mobile_menu.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) !important;
  }

  body:not(.home) #header .globalMenuSp.site_mobile_menu ul {
    display: grid !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  body:not(.home) #header .globalMenuSp.site_mobile_menu li {
    margin: 0 !important;
    border-bottom: 1px solid var(--ab-line);
  }

  body:not(.home) #header .globalMenuSp.site_mobile_menu li:last-child {
    border-bottom: 0;
  }

  body:not(.home) #header .globalMenuSp.site_mobile_menu a {
    display: block !important;
    padding: 15px 4px !important;
    color: var(--ab-ink) !important;
    font-family: "Noto Sans JP", sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
  }

  .ab-section-heading,
  .ab-message-grid,
  .ab-profile-card,
  .ab-access-grid {
    grid-template-columns: 1fr;
  }

  .ab-section-heading {
    gap: 20px;
  }

  .ab-message-photo {
    min-height: 520px;
  }

  .ab-message-photo img {
    object-position: center 18%;
  }

  .ab-profile-card {
    gap: 24px;
  }
}

@media (max-width: 600px) {
  body:not(.home).admin-bar #header.site_header {
    top: 46px !important;
  }

  .ab-lower-shell,
  body:not(.home) .pankuzu,
  body:not(.home) .breadcrumb,
  body:not(.home) .section_inner,
  body:not(.home) .wrap_r:not(.site_header_inner):not(.footer_inner),
  body:not(.home) .site-footer .footer_inner {
    width: calc(100% - 32px) !important;
  }

  .ab-page-hero {
    padding: 68px 0 44px;
  }

  .ab-page-hero h1 {
    font-size: 40px !important;
    letter-spacing: -0.045em !important;
  }

  .ab-about-section,
  .ab-contact-section {
    padding: 72px 0;
  }

  .ab-section-heading {
    margin-bottom: 34px;
  }

  .ab-section-heading h2 {
    font-size: 31px !important;
  }

  .ab-message-copy,
  .ab-profile-card,
  .ab-access-card,
  .ab-contact-card {
    padding: 28px;
    border-radius: 22px;
  }

  .ab-message-copy p,
  .ab-profile-bio {
    font-size: 14px;
    line-height: 2;
  }

  .ab-message-photo {
    min-height: 430px;
    border-radius: 22px;
  }

  .ab-history-list,
  .ab-company-list {
    padding: 8px 24px;
    border-radius: 22px;
  }

  .ab-history-list li,
  .ab-company-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 21px 0;
  }

  .ab-access-map,
  .ab-access-map iframe {
    min-height: 340px;
    border-radius: 22px;
  }

  .ab-contact-card h2 {
    margin-bottom: 28px !important;
    font-size: 29px !important;
  }

  .ab-form-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 0;
  }

  .ab-form-label {
    padding-top: 0;
  }

  .ab-consent-box {
    padding: 20px;
    text-align: left;
  }

  .ab-form-submit button,
  .ab-submit-button {
    width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.home) .lower_page_ttl_bg {
    padding: 68px 0 44px !important;
  }

  body:not(.home) .lower_page_ttl_bg h1,
  body:not(.home) .lower_page_ttl {
    font-size: 40px !important;
  }
}

@media (max-width: 782px) {
  body:not(.home).admin-bar #header.site_header {
    top: 46px !important;
  }
}

/* --------------------------------------------------------------------------
 * Template compatibility layer
 * Keep the lower-page markup deliberately small while sharing the same visual
 * language as the front page. These selectors correspond to the current PHP
 * templates and sit last so legacy theme rules cannot win the cascade.
 * ----------------------------------------------------------------------- */
.ab-lower-section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 42px;
  align-items: end;
  margin: 0 0 46px;
}

.ab-lower-section-head > p {
  grid-column: 1 / -1;
  margin: 0 0 -24px;
  color: var(--ab-blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.14em;
}

.ab-lower-section-head h2 {
  grid-column: 1 / -1;
  max-width: 820px;
  margin: 0 !important;
  color: var(--ab-ink) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: clamp(32px, 4.5vw, 58px) !important;
  font-weight: 800 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.05em !important;
}

.ab-section-soft {
  background: var(--ab-surface);
}

.ab-message-sign {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 38px !important;
  color: var(--ab-ink) !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
}

.ab-message-sign span {
  color: var(--ab-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ab-message-portrait {
  min-height: 610px;
  margin: 0;
  overflow: hidden;
  background: #e9edf7;
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-message-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 610px;
  object-fit: cover;
  object-position: center top;
}

.ab-profile-card {
  grid-template-columns: 230px minmax(0, 1fr);
}

.ab-profile-card .ab-profile-role {
  margin: 0;
  color: var(--ab-blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.8;
  letter-spacing: 0.04em;
}

.ab-profile-card > p:last-child {
  margin: 0;
  color: #3f4551;
  font-size: 15px;
  line-height: 2.15;
}

.ab-history-list li time {
  color: var(--ab-blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.8;
  letter-spacing: 0.03em;
}

.ab-history-list li p {
  margin: 0;
  color: #313641;
  font-size: 14px;
  line-height: 1.9;
}

.ab-company-list > div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 32px;
  padding: 25px 0;
  border-bottom: 1px solid var(--ab-line);
}

.ab-company-list > div:last-child {
  border-bottom: 0;
}

.ab-company-list > div dt,
.ab-company-list > div dd {
  margin: 0;
}

.ab-company-list > div dt {
  color: #686f7d;
  font-size: 13px;
  font-weight: 700;
}

.ab-company-list > div dd {
  color: var(--ab-ink);
  font-size: 14px;
  line-height: 1.9;
}

.ab-company-list small {
  color: var(--ab-muted);
  font-size: 11px;
}

.ab-access-grid > address {
  display: flex;
  align-items: center;
  min-height: 210px;
  margin: 0;
  padding: 38px;
  color: var(--ab-ink);
  background: #fff;
  border: 1px solid rgba(20, 30, 65, 0.08);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
  font-size: 14px;
  font-style: normal;
  line-height: 2;
}

.ab-map-frame {
  min-height: 420px;
  overflow: hidden;
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
}

.ab-contact-shell {
  width: min(1120px, calc(100% - 48px));
}

.ab-contact-intro {
  width: min(760px, 100%);
  margin-bottom: 38px;
}

.ab-contact-intro h2 {
  margin: 16px 0 20px !important;
  color: var(--ab-ink) !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: clamp(30px, 4vw, 48px) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.04em !important;
}

.ab-contact-intro p {
  margin: 0;
  color: var(--ab-muted);
  font-size: 15px;
  line-height: 2;
}

.ab-contact-intro p:first-child {
  color: var(--ab-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.ab-contact-form-v2 {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 68px);
  background: #fff;
  border: 1px solid rgba(20, 30, 65, 0.08);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow);
}

.ab-contact-form-v2 .ab-form-row > label {
  padding-top: 13px;
  color: var(--ab-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.ab-contact-form-v2 .is-required,
.ab-contact-form-v2 .is-optional {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 1px;
}

.ab-contact-form-v2 .is-required {
  color: #b22645;
  background: #fce9ee;
}

.ab-contact-form-v2 .is-optional {
  color: #697181;
  background: #eef0f4;
}

.ab-policy-box {
  margin-top: 30px;
  padding: 24px;
  background: var(--ab-surface);
  border-radius: 16px;
  text-align: center;
}

.ab-policy-box label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ab-ink);
  font-size: 14px;
  line-height: 1.7;
}

.ab-policy-box input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
}

.ab-policy-box a {
  display: inline-block;
  margin-top: 12px;
  color: var(--ab-blue);
  font-size: 12px;
  font-weight: 700;
}

button.ab-form-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: center;
  gap: 12px;
  min-width: 250px !important;
  min-height: 58px !important;
  margin: 34px auto 0 !important;
  padding: 0 30px !important;
  color: #fff !important;
  background: var(--ab-blue) !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-family: "Noto Sans JP", sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

button.ab-form-submit:hover {
  background: var(--ab-blue-dark) !important;
  transform: translateY(-2px);
}

.ab-form-message.is-success {
  color: #12623b;
  background: #e9f8ef;
}

.ab-form-message.is-error {
  color: #9d2440;
  background: #fdecef;
}

@media (max-width: 760px) {
  .ab-lower-section-head {
    display: block;
    margin-bottom: 30px;
  }

  .ab-lower-section-head > p {
    margin: 0 0 10px;
  }

  .ab-lower-section-head h2 {
    font-size: clamp(29px, 9vw, 40px) !important;
  }

  .ab-message-portrait,
  .ab-message-portrait img {
    min-height: 420px;
  }

  .ab-profile-card,
  .ab-company-list > div {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ab-access-grid > address {
    min-height: 0;
    padding: 26px;
  }

  .ab-map-frame,
  .ab-map-frame iframe {
    min-height: 330px;
  }

  .ab-contact-shell {
    width: min(100% - 28px, 1120px);
  }

  .ab-contact-intro {
    text-align: left;
  }

  .ab-contact-form-v2 {
    padding: 24px 20px 28px;
    border-radius: 22px;
  }

  .ab-contact-form-v2 .ab-form-row > label {
    padding-top: 0;
  }

  .ab-policy-box {
    text-align: left;
  }

  .ab-policy-box label {
    align-items: flex-start;
    justify-content: flex-start;
  }

  button.ab-form-submit {
    width: 100% !important;
    min-width: 0 !important;
  }
}
