/* Center the selection marker inside the selected link or button itself. */
html.hashira body.atsumi-site .assembled-nav > a[aria-current="page"]::after,
html.hashira body.atsumi-site .assembled-nav > .radial-medical > .entry-medical[aria-current="page"]::after {
  content: "" !important;
  position: absolute;
  inset: auto 22% 0;
  width: auto;
  height: 3px;
  margin: 0;
  border: 0;
  transform: none;
  background: #765f47;
}

/* These cards use the common palette by purpose, independent of their order. */
body .service-guides .service-card[data-service-index="3"] {
  background: #ffffe9;
  border-color: #ebebc9;
}
body .service-guides .service-card[data-service-index="4"] {
  background: #f1eff9;
  border-color: #dfd9ed;
}
body .service-guides .service-card[data-service-index="3"]:is(:hover, :focus-visible) { background: #f9f9d5; }
body .service-guides .service-card[data-service-index="4"]:is(:hover, :focus-visible) { background: #e8e1f4; }

/* Center occupied slots while retaining the v4 button basis and spacing. */
html.hashira #medical-intro .medical-intro-links:has(> li):not(:has(> li:nth-child(4))) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
html.hashira #medical-intro .medical-intro-links:has(> li):not(:has(> li:nth-child(4))) > li {
  flex: 0 0 min(100%, max(210px, calc((100% - 48px) / 4)));
}
@media (max-width: 640px) {
  html.hashira #medical-intro .medical-intro-links:has(> li):not(:has(> li:nth-child(4))) > li {
    flex-basis: calc((100% - 10px) / 2);
  }
}
@media (max-width: 359px) {
  html.hashira #medical-intro .medical-intro-links:has(> li):not(:has(> li:nth-child(4))) > li { flex-basis: 100%; }
}

html.hashira :is(.medical-menu-grid, .nav-subject-links, .medical-intro-links, .curve-subjects) a > .subject-label-long {
  flex: 1 1 0;
  min-inline-size: 0;
  overflow: clip;
  white-space: nowrap;
  letter-spacing: normal;
  line-height: 1.2;
}
html.hashira .subject-label-fit {
  display: inline-block;
  width: max-content;
  white-space: nowrap;
  transform: scaleX(var(--subject-label-scale, 1));
  transform-origin: left center;
}
html.hashira body.atsumi-site :is(.medical-menu-grid, .nav-subject-links) a .subject-label {
  font-weight: 400;
}

/* Equipment listings: one section per item, with text and photo aligned. */
html.hashira .curve-main .department-equipment .department-equipment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 31.11%);
  grid-template-rows: auto;
  align-items: start;
  column-gap: clamp(18px, 3vw, 40px);
  row-gap: 16px;
  border-block-start: 1px solid #ded2c5;
  margin-block: 0;
  padding-block: clamp(24px, 3vw, 36px);
}
html.hashira .curve-main .department-equipment .department-equipment-item .equipment-copy {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
}
html.hashira .curve-main .department-equipment .equipment-copy h4 {
  margin: 0;
  font-weight: 700;
  font-size: 24px;
  color: #514132;
}
html.hashira .curve-main .department-equipment .equipment-copy p:first-of-type {
  margin-block-start: 12px;
}
html.hashira .curve-main .department-equipment .equipment-copy p:last-child {
  margin-block-end: 0;
}
html.hashira .curve-main .department-equipment .department-equipment-item .equipment-visual {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 280px;
  min-width: 0;
  margin: 0;
  justify-self: end;
  align-self: start;
}
html.hashira .curve-main .department-equipment .department-equipment-item .equipment-visual[data-photo-shape="portrait"] {
  max-width: 180px;
}
html.hashira .curve-main .department-equipment .equipment-photo-treatment {
  width: 100%;
  margin: 0;
}
html.hashira .curve-main .department-equipment .department-equipment-item .equipment-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 12px;
  object-fit: contain;
}
@media (max-width: 760px) {
  html.hashira .curve-main .department-equipment .department-equipment-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  html.hashira .curve-main .department-equipment .department-equipment-item .equipment-visual {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
  html.hashira .curve-main .department-equipment .equipment-copy h4 { font-size: 20px; }
}

/* Single-column source tables keep their complete row structure. */
html.hashira .medical-content-table {
  width: 100%;
  margin-block: 16px 24px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #ddd1c3;
  border-radius: 12px;
  table-layout: fixed;
}
html.hashira .medical-content-table td {
  padding: clamp(10px, 2vw, 16px) clamp(12px, 2.5vw, 22px);
  line-height: 1.8;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
html.hashira .medical-content-table tr + tr td { border-top: 1px solid #e7ddd1; }
html.hashira .medical-content-table tr:nth-child(even) td { background: #faf7f3; }
