#ndx-table-container,
#ndx-item-container {
  /*
  --main-color: #04b7de;
  --main-dark-color: #13b0e4;
  --main-light-color: #def2fe;
  --main-text-black: #111;
  */
  --main-text-blue: #224c64;

  --star-high-color: #ff2600;
  --star-mid-color: #ff7e33;
  --star-low-color: #ffaf54;

  font-size: 14px;
  color: var(--main-text-black);
  text-align: left;
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, arial, helvetica,
    Hiragino Kaku Gothic ProN, "ヒラギノ角ゴ ProN W3", Meiryo, sans-serif;
  font-weight: normal;
  word-break: break-word;
  word-wrap: break-word;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;

  svg.icon {
    width: 20px;
    height: 20px;
    color: #999;
  }
  svg.icon-arrow-down {
    font-size: 20px;
    width: 20px;
    height: 20px;
  }
  svg.icon-autorenew {
    font-size: 12px;
    width: 12px;
    height: 12px;
  }
  svg.icon-arrow-up-right {
    color: #fff;
    width: 14px;
    height: 14px;
    margin-left: 4px;
  }

  b {
    all: unset;
    display: block;
    &::before,
    &::after {
      all: unset;
      content: unset;
    }
  }

  b {
    background: linear-gradient(transparent 60%, rgba(254, 198, 214, 0.6) 60%);
    padding: 0 2px 2px;
    font-weight: 700;
    display: inline;
  }

  button {
    outline: none;
  }

  .hidden {
    display: none;
  }

  .score-high {
    color: var(--star-high-color);
  }
  .score-mid {
    color: var(--star-mid-color);
  }
  .score-low {
    color: var(--star-low-color);
  }
  .custom-score-label {
    font-weight: bold;
  }
  .custom-star-rating {
    display: flex;
    align-items: center;
    font-family: sans-serif;
    .custom-stars {
      position: relative;
      display: inline-block;
      font-size: 10px;
      font-weight: bold;
      line-height: 1;
      white-space: nowrap;
    }
    .custom-stars-outer {
      color: #ccc;
    }
    .custom-stars-inner {
      position: absolute;
      top: 0;
      left: 0;
      white-space: nowrap;
      overflow: hidden;
      pointer-events: none;
    }
    .custom-stars-text {
      font-weight: bold;
    }
  }

  .feedback {
    display: flex;
    -webkit-box-pack: end;
    justify-content: end;
    a {
      display: flex;
      align-items: center;
      gap: 4px;
      text-decoration: none;
      color: #999;
      font-size: 12px;
      letter-spacing: normal;
      &:hover {
        text-decoration: underline;
      }
      img {
        width: 16px;
        height: 16px;
      }
    }
  }

  .rating {
    position: relative;
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    letter-spacing: -1px;
  }
  .stars-base i {
    color: #e7e7e7;
  }
  .stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    color: var(--star-low-color);
  }

  .ndx-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
    margin: 12px 0;
    button {
      cursor: pointer;
      min-height: 32px;
      padding: 4px 8px;
      background-color: #fff;
      border: 1px solid #e7e7e7;
      border-radius: 4px;
      box-shadow: none;
      font-weight: normal;
      outline: none;
      &:hover {
        background-color: #f7f7f7;
        color: var(--main-text-black);
      }
      &.selected {
        color: #0eb03a;
        background-color: #f5fcf6;
        border-color: #0eb03a;
      }
    }
  }

  .ndx-table-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    letter-spacing: normal;
    .ndx-table {
      table-layout: fixed;
      width: 100%;
      border-collapse: collapse;
      font-size: 10px;
      line-height: 1.4;

      th,
      td,
      p,
      span {
        font-size: 10px;
        line-height: 1.375;
      }

      th,
      td {
        color: var(--main-text-black);
        padding: 4px;
        white-space: normal;
        word-break: break-word;
        box-sizing: border-box;
        vertical-align: middle;
      }
      th {
        border: 1px solid #c1c1c1;
        border-top: 4px solid #a99667;
        background-color: #fcfdfd;
        width: 60px;
        color: #666;
        &:nth-child(4),
        &:nth-child(13),
        &:nth-child(14),
        &:nth-child(15) {
          background-color: #f2efea;
        }
        &:nth-child(8),
        &:nth-child(9),
        &:nth-child(10),
        &:nth-child(11),
        &:nth-child(12) {
          background-color: #f5f5f3;
        }
        &.name {
          text-align: left;
        }
        &.img {
          text-align: center;
          width: 50px;
        }
        &.url {
          width: 60px;
        }
      }
      td {
        height: 56px;
        border: 1px solid #c1c1c1;
        &.name {
          p:nth-child(1) {
            color: var(--main-text-black);
            font-weight: bold;
          }
          a {
            text-decoration: underline;
            cursor: pointer;
            color: var(--main-text-black);
          }
        }
        .rankimg {
          width: 20px;
          margin-left: 6px;
          margin-bottom: 4px;
        }
        .rank {
          align-items: center;
          border-radius: 999px;
          display: flex;
          justify-content: center;
          font-weight: 700;
          height: 16px;
          width: 16px;
          min-width: 16px;
          padding: 0 2px;
          margin-left: 8px;
          text-wrap-mode: nowrap;
        }
        .no1 {
          background-color: #f2b50d;
          color: #fff;
        }
        .no2 {
          background-color: #738c8c;
          color: #fff;
        }
        .no3 {
          background-color: #b36b4d;
          color: #fff;
        }
        &:nth-child(8),
        &:nth-child(9),
        &:nth-child(10),
        &:nth-child(11),
        &:nth-child(12) {
          font-weight: bold;
        }
        p {
          -webkit-box-orient: vertical;
          display: -webkit-box;
          -webkit-line-clamp: 3;
          overflow: hidden;
          margin-bottom: 0;
        }
        img.img {
          max-height: 40px;
          max-width: 40px;
        }
        a.url {
          display: flex;
          align-items: center;
          height: 40px;
          background-color: #0eb03a;
          border-radius: 4px;
          box-shadow: inset 0px -4px 0px rgba(0, 0, 0, 0.1);
          cursor: pointer;
          position: relative;
          vertical-align: top;
          width: auto;
          padding: 0px 0px 4px;
          min-height: 40px;
          color: #fff;
          text-decoration: none;
        }
        svg.icon-close {
          color: #b54300;
          font-size: 16px;
          width: 16px;
          height: 16px;
        }
        svg.icon-check {
          color: #02aa74;
          font-size: 16px;
          width: 16px;
          height: 16px;
        }
      }
      th:nth-child(1),
      td:nth-child(1) {
        position: sticky;
        left: 0;
        z-index: 2;
        width: 32px;
        border-left: 1px solid #ccc;
        border-right: 0;
      }
      th:nth-child(2),
      td:nth-child(2) {
        position: sticky;
        left: 32px; /* 1列目の幅と同じ */
        z-index: 2;
        width: 85px;
        border-right: none;
        border-left: 0;
        &::after {
          content: "";
          position: absolute;
          top: 0;
          right: 0;
          width: 4px; /* 線の太さ */
          height: 100%;
          border-right: 3px double #e7e7e7;
          pointer-events: none;
        }
      }
      th:nth-child(3),
      td:nth-child(3) {
        border-left: none;
      }
      th:last-child,
      td:last-child {
        border-left: 1px solid #ccc;
      }
      tr:nth-child(2n-1) {
        background-color: #fff;
        td:nth-child(1),
        td:nth-child(2) {
          background-color: #fff;
        }
      }
      tr:nth-child(2n) {
        background-color: #fbfbfb;
        td:nth-child(1),
        td:nth-child(2) {
          background-color: #fbfbfb;
        }
      }
      tr:last-child {
        border-bottom: 1px solid #ccc;
      }
    }
  }
  .ndx-table-wrapper tbody tr:nth-of-type(n + 11) {
    display: none;
  }
  .ndx-table-wrapper tbody tr:nth-of-type(10) td {
    border-bottom: 1px solid #ccc;
  }
  #ndx-table-all {
    display: none;
  }
  #ndx-table-all:checked ~ .ndx-table-wrapper tbody tr:nth-of-type(10) td {
    border-bottom: none;
  }
  #ndx-table-all:checked ~ .ndx-table-wrapper tbody tr {
    display: table-row;
  }
  #ndx-table-all:checked ~ label {
    display: none;
  }
  label[for="ndx-table-all"] {
    border: 1px solid #0eb03a;
    border-radius: 4px;
    display: block;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #0eb03a;
    margin-top: 12px;
    padding: 4px;
    &:hover {
      background-color: #f5fcf6;
    }
    svg.icon-arrow-down {
      color: #0eb03a;
    }
    div:nth-child(1) {
      bottom: 100%;
      position: absolute;
      width: 100%;
      z-index: 1;
      background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        #f7f7f7 100%
      );
      height: 30px;
    }
    div:nth-child(2) {
      display: inline-flex;
      align-items: center;
      padding: 6px;
    }
  }

  .ndx-map-wrapper {
    margin-top: 40px;
    .title {
      color: #333;
      background: none;
      font-feature-settings: "palt" 1;
      font-size: 20px;
      font-weight: bold;
      letter-spacing: 0.04em;
      line-height: 125%;
      margin-top: 2em;
      margin-bottom: 1em;
      padding: 0;
    }
    .area {
      font-size: 10px;
      font-weight: bold;
      background-color: #eee;
      padding: 4px 8px;
    }
    .map-container {
      position: relative;
      width: 100%;
      padding-top: 66.66%; /* 3:2 アスペクト比想定（元の比率より少し縦を狭くして見切れるように） */
      overflow: hidden;
    }

    .map-container iframe {
      position: absolute;
      top: -70px;
      left: 0;
      width: 100%;
      height: calc(100% + 70px);
      border: 0;
    }
  }

  .ndx-item-wrapper {
    margin-top: 28px;
    .ndx-item {
      border: 1px solid #c7b68a;
      padding: 20px 16px 28px;
      margin-top: 28px;
      & > * {
        margin-bottom: 28px;
      }
      .label-circle {
        color: #3073b5;
        border: 1px solid #3073b5;
        border-radius: 15px;
        padding: 2px 10px;
        letter-spacing: normal;
      }
      .title-wrapper {
        .rank {
          display: flex;
          align-items: center;
          margin-bottom: 12px;
          strong {
            font-size: 22px;
            margin: 0 4px;
          }
          img {
            width: 17px;
            margin-top: 6px;
          }
          .rank1,
          .rank2,
          .rank3 {
            color: #fff;
            font-weight: bold;
            padding: 4px 12px;
          }
          .rank1 {
            background-color: #c7b68a;
          }
          .rank2 {
            background-color: #d5d5d5;
          }
          .rank3 {
            background-color: #c1a386;
          }
        }
        h3 {
          margin: 0;
          padding: 0;
          &:before {
            display: none;
          }
        }
      }
      .btn-wrapper {
        text-align: center;
        .txt {
          font-size: 14px;
          font-weight: 700;
          color: #333;
          background: linear-gradient(transparent 64%, #fcf69f 0%);
        }
        .roundbtn {
          color: #fff;
          padding: 12px 24px;
          background-color: #0eb03a;
          display: inline-flex;
          justify-content: center;
          align-items: center;
          font-size: 16px;
          font-weight: 700;
          border-radius: 4px;
          box-shadow: inset 0px -4px 0px rgba(0, 0, 0, 0.1);
          cursor: pointer;
          text-decoration: none;
          margin-top: 6px;
          min-height: 50px;
          /* min-width: 280px; */
          width: 100%;
          transition: transform 0.25s, box-shadow 0.25s, -webkit-transform 0.25s;
          &:hover {
            box-shadow: 0 0 0 transparent !important;
            -webkit-transform: translate3d(0, 4px, 0);
            transform: translate3d(0, 4px, 0);
          }
        }
      }

      .desc {
        font-size: 14px;
        font-weight: 500;
        line-height: 1.8;
        margin-bottom: 20px;
        .small {
          font-size: 10px;
        }
      }
    }
    .score-wrapper {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      .col {
        color: #947e3b;
        flex: auto;
        font-weight: bold;
        div {
          font-size: 11px;
        }
        span {
          font-weight: bold;
          margin-left: 0.5em;
          line-height: 1.2;
        }
        .score {
          margin-bottom: 6px;
          padding-bottom: 2px;
          border-bottom: 0.5px solid;
        }
        .score span {
          font-size: 26px;
          margin-left: 0;
          line-height: 1.2;
        }
        &:nth-child(1) {
          width: 38%;
          max-width: 160px;
        }
        &:nth-child(2) {
          width: 62%;
          padding: 0 0 0 10px;
          line-height: 1.2;
        }
      }
    }
    .ref {
      font-size: 10px;
      text-align: right;
      margin: 10px 0;
      a {
        text-decoration: none;
        color: #bbb;
      }
    }
    .oname a {
      cursor: text;
    }

    .carousel-wrapper {
      .glide {
        position: relative;
        width: 100%;
      }

      .glide__slide {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
      }

      .glide__slide img {
        width: 320px;
        height: 240px;
        object-fit: cover;
        display: block;
        border: none;
      }

      .glide__arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        color: white;
        border: none;
        font-size: 24px;
        width: 30px;
        height: 30px;
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        z-index: 10;
        pointer-events: auto;
      }

      .glide__arrow--left {
        left: 15px;
        &:before {
          content: "";
          position: absolute;
          top: 50%;
          left: 50%;
          width: 12px;
          height: 12px;
          border-top: 2px solid currentColor;
          border-right: 2px solid currentColor;
          transform: translate(-35%, -50%) rotate(-135deg);
        }
      }

      .glide__arrow--right {
        right: 15px;
        &:before {
          content: "";
          position: absolute;
          top: 50%;
          left: 50%;
          width: 12px;
          height: 12px;
          border-top: 2px solid currentColor;
          border-right: 2px solid currentColor;
          transform: translate(-65%, -50%) rotate(45deg);
        }
      }

      .glide__slides {
        padding-left: 0;
      }

      .glide__arrows {
        pointer-events: none;
      }

      .glide__bullets {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 8px;
        z-index: 10;
        pointer-events: auto;
      }

      .glide__bullet {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.6);
        opacity: 0.6;
        border: none;
        transition: all 0.3s ease;
        cursor: pointer;
        padding: 0;
      }

      .glide__bullet--active {
        background: rgba(255, 255, 255, 1);
        opacity: 1;
      }
    }
    @media screen and (min-width: 768px) {
      .carousel-wrapper {
        .glide__slide img {
          width: 640px;
          height: 480px;
        }
        .glide__arrow {
          width: 35px;
          height: 35px;
        }
      }
    }

    .feature-summary-wrapper {
      display: flex;
      flex-wrap: wrap;
      gap: 6px 2%;
      div {
        padding: 6px 4px;
        border: 1.5px solid #888;
        font-weight: bold;
        font-size: 11px;
        background: #fff;
        position: relative;
        text-align: center;
        width: 32%;
        &.no {
          color: #bbb;
          border-color: #bbb;
          background: #fafafa;
          position: relative;
          overflow: hidden;

          > span {
            font-size: 11px;
            position: relative;
            z-index: 1;
            display: inline-block;
          }

          &:after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            z-index: 0;
            width: 100%;
            height: 100%;
            background-image: linear-gradient(
              to left bottom,
              #fafafa 49%,
              #bbb 49.5%,
              #bbb 50.5%,
              #fafafa 51%
            );
            pointer-events: none;
          }
        }
      }
    }

    .price-wrapper {
      .price-tab {
        display: flex;
        flex-wrap: wrap;
        label {
          order: -1;
          min-width: 80px;
          padding: 4px 8px;
          background-color: #fff;
          color: #c7b68a;
          font-weight: 700;
          font-size: 14px;
          margin-bottom: 0;
          text-align: center;
          cursor: pointer;
        }
        input {
          display: none;
        }
        & > div {
          display: none;
          width: 100%;
          padding: 20px;
          background-color: #fff;
          border: 2px solid #c7b68a;
        }
        label:has(:checked) {
          background-color: #c7b68a;
          color: #fff;
        }
        label:has(:checked) + div {
          display: block;
        }
      }
    }

    .recs-wrapper {
      font-size: 14px;
      color: #333;
      margin-top: -10px;

      .recs {
        color: var(--main-text-blue);
        background-color: #fff;
        font-size: 16px;
        font-weight: bold;
        display: inline-flex;
        left: 1em;
        line-height: 1;
        padding: 0.5em;
        position: relative;
        top: 1em;
        z-index: 1;
        max-width: 90%;
      }
      .recsc {
        border: 2px solid var(--main-text-blue);
        clear: both;
        margin-top: -2px;
        padding: 2em 1.25em 1.25em;
        position: relative;
        z-index: 0;
        li {
          font-weight: bold;
          list-style-type: disc;
        }
      }
    }

    .ndx-item-table {
      table {
        font-size: 14px;
        color: var(--main-text-black);
        line-height: 1.375;
        th,
        td {
          border: 1px solid #c1c1c1;
          vertical-align: middle;
          padding: 0.5em 0.75em;
          font-size: 14px;
          font-weight: normal;
          text-align: center;
          white-space: pre-wrap;
          &.left {
            text-align: left;
          }
        }
        th {
          width: 38%;
          background-color: #f2efea;
          color: var(--main-text-blue);
          font-weight: bold;
        }
      }

      .toggle-table-wrapper {
        position: relative;
        max-height: 180px;
        overflow: hidden;
        display: block;
        transition: max-height 0.3s ease;
        &:after {
          content: "";
          position: absolute;
          bottom: 0;
          left: 0;
          width: 100%;
          height: 60px;
          background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0) 0%,
            #fff 100%
          );
          pointer-events: none;
          opacity: 1;
          transition: opacity 0.3s ease;
        }
      }
      .toggle-checkbox:checked ~ .toggle-table-wrapper {
        max-height: 1000vh;
      }
      .toggle-checkbox:checked ~ .toggle-table-wrapper::after {
        opacity: 0;
      }
      .toggle-checkbox:checked ~ .toggle-label {
        display: none;
      }
      .toggle-checkbox {
        display: none;
        &:checked ~ .toggle-label::after {
          display: none;
        }
      }
      .toggle-label {
        display: block;
        width: fit-content;
        margin: 8px auto 0 auto;
        border-bottom: 1px solid #c1c1c1;
        cursor: pointer;
        span {
          font-size: 12px;
          .icon-arrow-down {
            width: 24px;
            height: 24px;
            vertical-align: middle;
          }
        }
      }
    }

    .access-wrapper,
    .doctors-wrapper {
      summary {
        border-bottom: 1px solid #c7b68a;
        color: var(--main-text-blue);
        cursor: pointer;
        display: grid;
        grid-template-columns: 1fr 30px;
        gap: 6px;
        font-size: 16px;
        font-weight: bold;
        line-height: 1.5;
        align-items: center;
        padding-bottom: 4px;
        &::-webkit-details-marker {
          display: none;
        }
        .icon-arrow-down {
          width: 36px;
          height: 36px;
          fill: var(--main-text-blue);
        }
      }
      details {
        div {
          border-bottom: 1px solid #c7b68a;
          color: var(--main-text-blue);
          font-size: 16px;
          font-weight: bold;
          padding-bottom: 8px;
          margin-top: 8px;
          span {
            color: #808080;
            margin-left: 1em;
          }
          &:nth-child(2) {
            margin-top: 10px;
          }
        }
      }
      details[open] {
        summary {
          border: none;
        }
        .icon-arrow-down {
          transform: rotate(180deg);
        }
      }
    }

    .review-wrapper {
      & > div:first-child {
        color: var(--main-text-blue);
        font-size: 16px;
        font-weight: bold;
        line-height: 1.5;
      }

      .review-card-wrapper {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 16px 0;
        .review-card {
          flex: 0 0 65%;
          background: #fff;
          border: 1px solid #ddd;
          border-radius: 4px;
          padding: 12px;
          box-sizing: border-box;

          .review-title {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 8px;
          }

          .review-body {
            font-size: 12px;
            color: #333;
            height: 150px;
            overflow: hidden;
            position: relative;
            &:after {
              content: "";
              position: absolute;
              bottom: 0;
              left: 0;
              width: 100%;
              height: 30px;
              background: linear-gradient(to top, #fff, rgba(255, 255, 255, 0));
            }
          }

          .review-footer {
            text-align: center;
            padding-top: 4px;
            a {
              font-size: 12px;
              color: #888;
              text-decoration: none;
              svg.icon-arrow-up-right {
                color: #888;
                width: 10px;
                height: 10px;
              }
            }
          }
        }
      }
      @media screen and (min-width: 768px) {
        .review-card-wrapper {
          .review-card {
            flex: 0 0 40%;
          }
        }
      }
    }
    .accessmap-wrapper {
      .map-container {
        position: relative;
        width: 100%;
        padding-top: 66.66%; /* 3:2 アスペクト比想定（元の比率より少し縦を狭くして見切れるように） */
        overflow: hidden;
        iframe {
          position: absolute;
          top: -70px;
          left: 0;
          width: 100%;
          height: calc(100% + 70px);
          border: 0;
        }
      }
      .map-container-n {
        position: relative;
        width: 100%;
        overflow: hidden;
        iframe {
          width: 100%;
          aspect-ratio: 3 / 2;
          border: 0;
        }
      }
    }
  }
}
