/* Asia/Tokyo, 2025-10-11 12:00(UTC+09:00) index.css */

/* ========== 0) ページトークン（配色・寸法） ========== */
:root {
  --risk-border: #117713;
  --risk-head-bg: #117713;
  --risk-head-fg: #fff;
  --risk-plan-accent: #fffb00;

  --row-jishin: #e0ffec;
  --row-kasai: #e0ffec;
  --row-fusai: #e0ffec;
  --row-mizunure: #e0ffec;
  --row-tounan: #e0ffec;
  --row-suisai: #e0ffec;
  --row-haoson: #e0ffec;
  --row-qq: #9fd9f6;

  --row-header-bg: #fffff8;

  --danger: #c50f0f;
  --primary-blue: #0071bc;
}

/* ========== 2) リスクマトリクス ========== */
.about {
  /* Add top space before the about section on index only */
  padding: 2rem 0 0;
}
.risk-matrix {
  padding: 0;
  margin: 2rem 0 0; /* add some space above */
  background: #fff;
}


.risk-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: clamp(1.6rem, 1.5rem + 0.3vw, 1.8rem);
  table-layout: auto;
}

.risk-table thead th {
  font-size: clamp(1.8rem, 1.6rem + 0.5vw, 2.2rem);
  line-height: 1.4;
  font-weight: 400;
  background: var(--risk-head-bg);
  color: var(--risk-head-fg);
  text-align: center;
  white-space: normal;
}

.risk-table thead th .plan-letter {
  display: block;
  font-size: clamp(3.5rem, 2.6rem + 3.2vw, 6rem);
  line-height: 1;
  margin-top: 0.2em;
  color: var(--risk-plan-accent);
}

/* 「プラン」ラベルを少し大きく（デスクトップ表示時） */
.risk-table thead th[id^="plan-"] .plan-label {
  font-size: clamp(2rem, 1.8rem + 0.4vw, 2.3rem);
}

.risk-table thead tr.risk-header-image-row th:first-child {
  background: #fff;
  color: #000;
  border: 0;
  display: flex;
  align-items: center; /* ご契約プランを縦中央に */
}

.risk-table tbody th {
  background: #fff0f0;
  color: #000;
  padding: 0.8rem;
  text-align: left;
  vertical-align: top;
}

.risk-table tbody th[scope="row"],
.risk-table thead tr.risk-table-title-row th:first-child {
  background: var(--row-header-bg);
  color: #000;
}

.risk-table th,
.risk-table td {
  border: 1px solid var(--risk-border);
}

.risk-header-image-row th[colspan="4"] {
  text-align: right;
  background: #fff;
  padding: 0;
  border: none;
}

/* ヘッダーバッジ（formansiononly[2].svg）の下余白を消す */
.risk-header-image-row picture.align-right {
  display: block;         /* baseline ギャップ回避 */
  margin-left: auto;      /* 右寄せ維持 */
  line-height: 0;         /* 行ボックス由来の下余白をゼロに */
  width: fit-content;     /* コンテンツ幅に縮めて常に右寄せ */
}
.risk-header-image-row picture.align-right img {
  display: block;         /* 画像下の隙間防止（保険） */
  margin: 0;
}

.risk-table-title-row th:nth-child(2),
.risk-table-title-row th:nth-child(3) {
  border-color: #ffffff;
  color: #fff;
  background: var(--risk-head-bg);
  border-top: 0px solid var(--risk-border);
  border-right: 1px solid #ffffff;
  border-left: 0px solid var(--risk-border);
  border-bottom: 1px solid #ffffff;
}

.risk-table-title-row th:nth-child(4),
.risk-table-title-row th:nth-child(5) {
  background: #940c0c;
  color: #fff;
  border-top: 0px solid var(--risk-border);
  border-right: 1px solid #ffffff;
  border-left: 0px solid var(--risk-border);
  border-bottom: 1px solid #ffffff;
}

.risk-table-title-row th {
  vertical-align: top;
}

.risk-table thead tr.risk-table-title-row th[id^="plan-"] {
  text-align: center;
  vertical-align: top;
}

.risk-table td[data-label^="プラン"] {
  text-align: center;
}

.legend-ok,
.legend-no {
  font-weight: 700;
  padding: 1.5rem;
  font-size: clamp(2.6rem, 2.2rem + 0.6vw, 4.5rem);
  line-height: 1.2;
}

.legend-ok {
  color: var(--primary-blue);
}

.legend-no {
  color: var(--danger);
}

.risk-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  color: #000;
  line-height: 1.3;
  white-space: normal;
  min-width: 0;
}

.risk-title .risk-label {
  min-width: 0;
}

.risk-title img {
  margin: 0.4rem 0.6rem 0.4rem 3rem;
}

.risk-example {
  margin: 0 0 0 2rem;
  padding: 0;
  list-style: none;
  font-size: clamp(1.6rem, 1.5rem + 0.4vw, 2rem);
  font-weight: 400;
}

.risk-example li {
  position: relative;
  padding-left: 1.8em;
}

.risk-example li::before {
  content: "例）";
  position: absolute;
  left: 0;
}

.icon-maru,
.icon-batsu {
  width: 50px;
  height: 50px;
  display: block;
  margin: auto;
}

.label-ok,
.label-none {
  display: inline-block;
  margin: auto;
  padding: 0.2rem 0.6rem;
  font-weight: 700;
  border-radius: 4px;
  font-size: clamp(1.6rem, 1.5rem + 0.3vw, 2rem);
  line-height: 1.3;
}

.label-ok {
  color: #000;
}

.label-none {
  color: var(--danger);
}

.risk-table tr.row-qq td:has(.label-ok) {
  background-color: var(--row-suisai);
}



.risk-table tr.row-jishin>td {
  background: var(--row-jishin);
}

.risk-table tr.row-kasai>td {
  background: var(--row-kasai);
}

.risk-table tr.row-fusai>td {
  background: var(--row-fusai);
}

.risk-table tr.row-mizunure>td {
  background: var(--row-mizunure);
}

.risk-table tr.row-tounan>td {
  background: var(--row-tounan);
}

.risk-table tr.row-suisai>td {
  background: var(--row-suisai);
}

.risk-table tr.row-haoson>td {
  background: var(--row-haoson);
}

.risk-table td:has(img.icon-batsu),
.risk-table td.is-none {
  background: #ffcacb;
}

@supports selector(:has(*)) {
  .risk-table td:has(.label-none) {
    background: #ffcacb;
  }
}

/* PC 幅（600px〜）：列幅の比率固定 */
@media (min-width: 600px) {

  .risk-table thead th:first-child,
  .risk-table tbody th[scope="row"] {
    width: 60%;
    min-width: 60%;
    max-width: 60%;
  }

  .risk-table thead th:not(:first-child),
  .risk-table tbody td {
    width: 10%;
    min-width: 10%;
    max-width: 10%;
    text-align: center;
  }
}

/* スクロールが発生（needWide）した時の幅配分最適化 */
@media (min-width: 600px) {
  /* デスクトップ: 左列をやや絞り、各プラン列を+1%ずつ広げる */
  .risk-table.expanded thead th:first-child,
  .risk-table.expanded tbody th[scope="row"] {
    width: 56%;
    min-width: 56%;
    max-width: 56%;
  }
  .risk-table.expanded thead th[id^="plan-"],
  .risk-table.expanded tbody td:nth-child(2),
  .risk-table.expanded tbody td:nth-child(3),
  .risk-table.expanded tbody td:nth-child(4),
  .risk-table.expanded tbody td:nth-child(5) {
    width: 11%;
    min-width: 11%;
    max-width: 11%;
  }
}

/* スクロール表示時はテーブル領域をフル幅に拡張（コンテナをはみ出して可視領域を広げる） */
.risk-matrix .table-scroll-wrapper[data-right-visible],
.risk-matrix .table-scroll-wrapper[data-left-visible] {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
  box-sizing: border-box;
}

/* スマホ調整（〜600px） */
@media (max-width: 600px) {

  .risk-table thead th:first-child,
  .risk-table tbody th[scope="row"] {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
  }

  .risk-label {
    display: inline-block;
    margin-right: 0.3em;
  }

  .risk-header-image-row img {
    width: 300px;
  }

  .risk-title {
    gap: 0.6rem;
  }

  .risk-title img {
    width: clamp(56px, 12vw, 80px);
    height: auto;
    margin: 0;
    flex: 0 0 auto;
  }

  .risk-example {
    margin-left: 0.5rem;
  }

  .risk-example li {
    margin-bottom: 0;
    padding-left: 2.5rem;
  }

  /* Mobile: move risk icons to the right of the example list and minimize spacing */
  .risk-title img {
    display: none; /* do not place icon next to the heading on mobile */
  }

  .risk-example::before {
    content: "";
    float: right;
    width: clamp(64px, 14vw, 96px);   /* slightly larger on mobile */
    height: clamp(64px, 14vw, 96px);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin: 0 0 4px 6px; /* minimal spacing around the image on mobile */
  }

  /* Row-specific icons */
  .row-jishin .risk-example::before { background-image: url('/images/icon/jishin2.svg'); }
  .row-kasai .risk-example::before { background-image: url('/images/icon/rakurai.svg'); }
  .row-fusai .risk-example::before { background-image: url('/images/icon/fusai.svg'); }
  .row-mizunure .risk-example::before { background-image: url('/images/icon/mizunure.svg'); }
  .row-tounan .risk-example::before { background-image: url('/images/icon/tounan.svg'); }
  .row-suisai .risk-example::before { background-image: url('/images/icon/suisai.svg'); }
  .row-haoson .risk-example::before { background-image: url('/images/icon/haoson.svg'); }

  .risk-legend {
    flex-direction: column;
    align-items: flex-start;
    font-size: var(--fs-small, clamp(1.4rem, 1.3rem + 0.2vw, 1.6rem));
  }

  .legend-ok,
  .legend-no {
    font-size: clamp(2.2rem, 2rem + 0.4vw, 2.6rem);
    line-height: 1;
    padding: 1rem;
  }

  .plan-header-cell .plan-title {
    line-height: 1.2;
    margin-bottom: 0;
  }

  .plan-header-cell .risk-legend {
    display: flex;
    gap: 0rem;
    line-height: 1;
  }

  .risk-table thead th[id^="plan-"],
  .risk-table tbody td:nth-child(2),
  .risk-table tbody td:nth-child(3),
  .risk-table tbody td:nth-child(4),
  .risk-table tbody td:nth-child(5) {
    width: 65px;
    min-width: 65px;
    max-width: 65px;
  }

  .risk-table thead th:first-child,
  .risk-table tbody th[scope="row"] {
    width: calc(65px * 4);
    min-width: calc(65px * 4);
    max-width: calc(65px * 4);
  }

  /* モバイル: 左列を240pxに絞り、その分を各プラン列に再配分（70px化） */
  .risk-table.expanded thead th:first-child,
  .risk-table.expanded tbody th[scope="row"] {
    width: 240px;
    min-width: 240px;
    max-width: 240px;
  }
  .risk-table.expanded thead th[id^="plan-"],
  .risk-table.expanded tbody td:nth-child(2),
  .risk-table.expanded tbody td:nth-child(3),
  .risk-table.expanded tbody td:nth-child(4),
  .risk-table.expanded tbody td:nth-child(5) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
  }

  .risk-table thead th[id^="plan-"] .plan-letter {
    font-size: 4rem;
    line-height: 1;
    margin-top: 0;
  }

  th[id^="plan-"] .plan-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  #plan-a .plan-letter-wrap,
  #plan-b .plan-letter-wrap,
  #plan-c .plan-letter-wrap,
  #plan-d .plan-letter-wrap {
    writing-mode: horizontal-tb;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
  }

  .risk-table {
    min-width: calc(100px + 52px * 4);
  }

  th[id^="plan-"] br {
    display: none;
  }

  :root {
    --plan-top-gap: 0.6em;
  }

  th[id^="plan-"] {
    position: relative;
    text-align: center;
    padding-top: calc(2.6em + var(--plan-top-gap));
    padding-bottom: 0;
  }

  th[id^="plan-"]::before {
    content: "プラン";
    position: absolute;
    top: var(--plan-top-gap);
    left: 50%;
    transform: translateX(-50%);
    writing-mode: vertical-rl;
    text-orientation: upright;
    line-height: 1;
    font-size: 0.9em; /* モバイル時の「プラン」を少し大きく */
  }

  th[id^="plan-"] .plan-letter-wrap {
    display: inline-grid;
    place-items: center;
    gap: 0.1em;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }

  th[id^="plan-"] .plan-letter,
  th[id^="plan-"] .plan-letter-wrap {
    line-height: 1;
  }

  #plan-a,
  #plan-b,
  #plan-c,
  #plan-d {
    padding-top: calc(2.8em + var(--plan-top-gap));
  }

  #plan-a::before,
  #plan-b::before,
  #plan-c::before,
  #plan-d::before {
    top: var(--plan-top-gap);
  }
}

/* プラン見出しセル */
.plan-header-cell {
  padding-top: 0;
  text-align: left;
  vertical-align: middle; /* 見出しセルを縦中央に */
  background: #fff;
  border: none;
}

/* タイトル行の一般指定（top）より強く、見出しセルだけ縦中央に */
.risk-table thead tr.risk-table-title-row th.plan-header-cell {
  vertical-align: middle;
  border-bottom: 1px solid #ffffff; /* 下線を他列と同じ白に統一 */
}

.plan-title {
  margin: 0 0 3.4rem;
  text-align: left;
}

.plan-header-cell,
.plan-header-cell .plan-title {
  color: #000;
}

.plan-letter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.plan-note {
  font-size: 0.7em;
  color: #fff;
  margin-top: 0.2em;
}

/* ========== 3) 参考データ ========== */
.reference-data {
  padding-top: 1rem;
  margin-top: 1rem;
  padding-bottom: 1rem;
  background: #d7e5ff;
}

.reference-text {
  font-size: clamp(2.1rem, 1.8rem + 1vw, 2.5rem);
  line-height: 1.6;
}

.highlight-water {
  color: #ff6e00;
  font-weight: 700;
}

.reference-box {
  display: flex;
  align-items: stretch;
  background: #f7fcee;
  border: 4px solid #00a16d;
  border-radius: 24px;
  overflow: hidden;
  max-width: var(--content-max-width);
  margin: 2rem auto;
}

.ref-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  background: #00875b;
  color: #fff;
  font-size: clamp(2rem, 1.7rem + 0.8vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.2rem;
  padding: 1.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
}

.ref-images {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 2rem;
  padding: 2rem;
}

.ref-images img {
  flex: 1 1 380px;
  max-width: 420px;
  width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  .reference-box {
    flex-direction: column;
    border-width: 3px;
  }

  .ref-label {
    writing-mode: horizontal-tb;
    width: 100%;
    text-align: center;
    padding: 0.8rem 0;
    font-size: clamp(2rem, 1.7rem + 0.8vw, 2.4rem);
  }

  .ref-images {
    flex-direction: column;
    gap: 1.6rem;
    padding: 1.6rem 1rem;
    align-items: center;
    justify-content: center;
  }

  .ref-images img {
    flex: 0 0 auto;
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
    margin-inline: auto;
  }

  .icon-maru,
  .icon-batsu {
    width: 36px;
    height: 36px;
  }
}

/* 読みやすさ微調整 */


.note-inline {
  color: #a50000;
}

/* ========== 4) QQ セクション ========== */
.qq-service-cell {
  background: #fff;
  padding: 1.6rem;
  font-weight: 400;
}

.qq-head {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3.2rem);
  line-height: 1.25;
}

.qq-logo {
  width: 280px;
  height: auto;
}

.qq-caption {
  color: #c50000;
  font-size: clamp(1.6rem, 1.5rem + 0.4vw, 2rem);
  margin: 0.4rem 0 0.8rem;
}

.qq-note {
  font-size: clamp(1.6rem, 1.5rem + 0.4vw, 2rem);
  margin: 0 0 1.2rem;
}

.qq-box {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.qq-box.water {
  background: #e5f4ff;
}

.qq-box.key {
  background: #fff2f2;
}

.qq-box-icon {
  width: 80px;
  height: auto;
  flex-shrink: 0;
}

.qq-box-title {
  margin: 0;
  font-size: clamp(1.6rem, 1.5rem + 0.4vw, 2rem);
  color: #0068b7;
}

.qq-box.key .qq-box-title {
  color: #c50000;
}

.qq-box-desc {
  margin: 0;
  font-size: clamp(1.6rem, 1.5rem + 0.3vw, 2rem);
  line-height: 1.5;
}

.qq-flyer {
  margin-top: 1.2rem;
}

.qq-flyer a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(1.6rem, 1.5rem + 0.4vw, 2rem);
}

.qq-flyer img {
  width: 24px;
  height: auto;
}

@media (max-width: 600px) {
  /* Mobile: place QQ service icons on the right with text wrapping under */
  .qq-box {
    display: block;
  }

  /* Hide original inline icon; we will render at desc only */
  .qq-box-icon {
    display: none;
  }

  /* Render icon next to description only */
  .qq-box-desc::before {
    content: "";
    float: right;
    width: clamp(64px, 14vw, 96px);
    height: clamp(64px, 14vw, 96px);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin: 0 0 4px 6px; /* minimal spacing */
  }

  .qq-box.water .qq-box-desc::before { background-image: url('/images/icon/toiletrepair.svg'); }
  .qq-box.key .qq-box-desc::before { background-image: url('/images/icon/doorkeyrepair.svg'); }

  .qq-logo {
    width: 100%;
    max-width: 180px;
    min-width: 100px;
    height: auto;
    display: block;
  }

  .qq-box>div {
    display: block;
  }

  .qq-box-title,
  .qq-box-desc {
    margin: 0;
  }
}

/* ========== 5) 屋外保管品／対象外セクション ========== */
.outdoor-items {
  padding: 1rem 0 1rem 0;
  background: #d9d9d9;
}

.item-lead {
  margin: 0 0 2rem;
  text-align: center;
  font-size: clamp(2.1rem, 1.8rem + 1vw, 2.5rem);
  line-height: 1.6;
  font-weight: 700;
}

.text-red {
  color: #c50000;
}

.item-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-list li {
  flex: 0 1 240px;
  text-align: center;
  font-size: clamp(1.6rem, 1.5rem + 0.2vw, 1.8rem);
}

.item-list figure {
  margin: 0;
  text-align: center;
}

.item-list figure img {
  margin: 0 auto;
}

.item-list img {
  width: 100%;
  height: auto;
  max-width: 100px;
}

.item-list figcaption {
  margin-top: 0.4rem;
  line-height: 1.6;
}

.item-note {
  text-align: center;
  font-size: clamp(1.6rem, 1.4rem + 1vw, 2.5rem);
  margin-top: 2rem;
  margin-bottom: 0;
  color: #117713;
  font-weight: 700;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .item-list {
    gap: 0.2rem;
  }

  .item-list li {
    flex: 0 1 calc(33.333% - 0.25rem);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .item-list img {
    width: auto;
    max-width: 70px;
  }

  .item-lead,
  .item-note {
    line-height: 1.4;
  }

  .item-lead br {
    display: none;
  }
}

/* 特約バナー */
.option-banner {
  margin: 2rem 0;
}

.option-inner {
  position: relative;
  padding: 2rem 12rem 2rem 2rem;
  background: #f7fce9;
  border: 2px solid #3a3a3a;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.option-title {
  flex: 1 1 100%;
  font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: center;
}

.option-list li {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: clamp(1.9rem, 1.7rem + 1.2vw, 3rem);
  line-height: 1.2;
}

.option-list img {
  width: 60px;
  height: auto;
}

.option-list .etc {
  margin-left: calc(60px + 1.2rem + 1rem);
  max-width: calc(100% - 12rem - 60px - 1.2rem - 1rem);
}

.mark-pink {
  background: linear-gradient(transparent 60%, #f8b6ff 60%);
  padding: 0 0.15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.etc {
  font-size: clamp(1.9rem, 1.7rem + 1.2vw, 3rem);
}

@media (max-width: 600px) {
  .option-inner {
    padding-right: 0;
  }

  .option-list .etc {
    flex: 1 1 100%;
    margin-left: calc(60px + 1.2rem);
    margin-top: 0.5rem;
  }
}

/* ========== 8) 細かな見映え調整 ========== */
.qq-service-cell * {
  font-weight: 400;
}

.qq-service-cell strong {
  font-weight: 700;
}

/* Items frame: outdoor / excluded */
.outdoor-items>.container {
  border: 2px solid #117713;
  border-radius: 20px;
  background: #fff;
  padding-block: 2rem;
  margin-block: 2rem;
  white-space: normal;
}

@media (max-width: 480px) {
  .outdoor-items>.container {
    margin-block: 1.2rem;
    padding-block: 1.2rem;
  }
}

.risk-table tbody th[scope="row"].balloon-hint,
.risk-table .qq-click {
  text-decoration: underline dotted;
  cursor: help;
}

#outdoor-items>.container {
  width: calc(100% - 2 * var(--page-gutter));
  max-width: calc(var(--content-max-width) - 2 * var(--page-gutter));
  margin-inline: auto;
  padding-inline: 0;
}

#outdoor-items>.container {
  padding: 3.2rem 2rem;
}

@media (max-width: 480px) {
  #outdoor-items>.container {
    padding: 2rem 1.6rem;
  }
}

.option-link-item {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  text-decoration: none;
}

.option-link-item:hover {
  text-decoration: underline;
}
