/* Asia/Tokyo, 2025-11-25 21:30(UTC+09:00) nagare.css */
:root {
  --flow-bg: #fff;
  --flow-odd: #f5fff6;
  --flow-even: #e9f4ff;
  --flow-arrow: var(--danger, #c50f0f);
  --flow-border: #e6e6e6;
  --flow-radius: 12px;
  --flow-gap: 4rem;
  --flow-img-w: 0px;
  --flow-text-max: 36ch;
  --flow-fs-base: var(--fs-base, clamp(1.6rem, 1.5rem + 0.3vw, 1.8rem));
  --flow-fs-title: var(--fs-title, clamp(2rem, 1.6rem + 1.2vw, 2.6rem));
  --flow-focus-ring: var(
    --focus-ring,
    3px solid rgba(0, 117, 201, 0.6)
  );
}

.contract-flow {
  padding-block: var(--section-space);
  margin: 0;
  background: var(--clr-bg-section, var(--flow-bg));
}

.contract-flow .container {
  margin-inline: auto;
  margin-block-end: 1rem;
}

@media (min-width: 768px) {
  .contract-flow {
    padding-block: var(--section-space);
    margin: 0;
  }
}

.flow-list {
  list-style: none;
  margin: 0;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--flow-gap);
}

.flow-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 2rem 1rem;
  border-radius: var(--flow-radius);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  outline: none;
}

.flow-item:nth-child(odd) {
  background: var(--flow-odd);
}

.flow-item:nth-child(even) {
  background: var(--flow-even);
}

.flow-item:focus-within {
  outline: var(--flow-focus-ring);
  outline-offset: 2px;
}

.flow-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(-1 * var(--flow-gap) / 2);
  transform: translateX(-50%);
  width: 2px;
  height: var(--flow-gap);
  background: var(--flow-arrow);
}

@media (min-width: 768px) {
  .flow-item::after {
    top: 50%;
    bottom: auto;
    left: auto;
    right: calc(-1 * var(--flow-gap) / 2);
    transform: translateY(-50%);
    width: var(--flow-gap);
    height: 2px;
  }
}

.flow-item:last-child::after {
  display: none;
}

.flow-item.is-current {
  box-shadow:
    0 0 0 3px var(--accent-blue, #0075c9) inset,
    0 2px 10px rgba(0, 0, 0, 0.06);
}

.flow-illust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: calc(var(--flow-img-w) * 0.9);
}

.flow-illust img {
  width: clamp(100px, 18vw, var(--flow-img-w));
  height: auto;
  margin: 2rem 1rem 1rem;
}

.flow-text {
  margin-top: 1rem;
  font-size: var(--flow-fs-base);
  line-height: 1.7;
  max-width: var(--flow-text-max);
  white-space: normal;
  text-align: left;
}

.flow-note {
  display: block;
  margin-top: 0.5rem;
  font-weight: 700;
  color: var(--danger, #c50f0f);
}

@media (prefers-contrast: more) {
  .flow-item {
    box-shadow: none;
    border: 2px solid #000;
    background: #fff !important;
  }

  .flow-item::after {
    background: #000;
  }

  .flow-note {
    color: #000;
  }
}

@media (forced-colors: active) {
  .flow-item {
    border: 1px solid CanvasText;
  }

  .flow-item::after {
    background: CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-item,
  .flow-item::after {
    transition: none !important;
  }
}

@media print {
  .contract-flow {
    padding: 0;
  }

  .flow-list {
    gap: 1.2rem;
  }

  .flow-item {
    box-shadow: none;
    background: #fff !important;
    border: 1px solid #ccc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .flow-item::after {
    display: none;
  }

  .flow-illust img {
    max-width: 100%;
  margin: 0rem 4rem 0rem 1rem;
  }
}

.flow-list--zigzag {
  --arrow-color: var(--flow-arrow, #af0404);
  --arrow-thickness: 5px;
  --arrow-head: 20px;  
  display: grid;
  gap: var(--flow-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));    
}

.flow-list--zigzag .flow-item::after,
.flow-list--zigzag .flow-item::before {
  content: none;
}

@media (min-width: 768px) {
  .flow-list--zigzag .flow-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .flow-list--zigzag .flow-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .flow-list--zigzag .flow-item:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }

  .flow-list--zigzag .flow-item:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }

  .flow-list--zigzag .flow-item:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
  }

  .flow-list--zigzag .flow-item:nth-child(1)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: calc(var(--flow-gap) - var(--arrow-head));
    height: var(--arrow-thickness);
    background: var(--arrow-color);
  }

  .flow-list--zigzag .flow-item:nth-child(1)::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% + (var(--flow-gap) - var(--arrow-head)));
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: var(--arrow-head) solid var(--arrow-color);
    border-top: var(--arrow-head) solid transparent;
    border-bottom: var(--arrow-head) solid transparent;
  }

  .flow-list--zigzag .flow-item:nth-child(2)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: calc(var(--flow-gap) - var(--arrow-head));
    height: var(--arrow-thickness);
    background: var(--arrow-color);
  }

  .flow-list--zigzag .flow-item:nth-child(2)::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% + (var(--flow-gap) - var(--arrow-head)));
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: var(--arrow-head) solid var(--arrow-color);
    border-top: var(--arrow-head) solid transparent;
    border-bottom: var(--arrow-head) solid transparent;
  }

  .flow-list--zigzag .flow-item:nth-child(3)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: var(--arrow-thickness);
    height: calc(var(--flow-gap) - var(--arrow-head));
    background: var(--arrow-color);
  }

  .flow-list--zigzag .flow-item:nth-child(3)::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + (var(--flow-gap) - var(--arrow-head)));
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: var(--arrow-head) solid var(--arrow-color);
    border-left: var(--arrow-head) solid transparent;
    border-right: var(--arrow-head) solid transparent;
  }

  .flow-list--zigzag .flow-item:nth-child(4)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    width: calc(var(--flow-gap) - var(--arrow-head));
    height: var(--arrow-thickness);
    background: var(--arrow-color);
  }

  .flow-list--zigzag .flow-item:nth-child(4)::before {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(100% + (var(--flow-gap) - var(--arrow-head)));
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: var(--arrow-head) solid var(--arrow-color);
    border-top: var(--arrow-head) solid transparent;
    border-bottom: var(--arrow-head) solid transparent;
  }

  .flow-list--zigzag .flow-item:nth-child(5)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    width: calc(var(--flow-gap) - var(--arrow-head));
    height: var(--arrow-thickness);
    background: var(--arrow-color);
  }

  .flow-list--zigzag .flow-item:nth-child(5)::before {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(100% + (var(--flow-gap) - var(--arrow-head)));
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-right: var(--arrow-head) solid var(--arrow-color);
    border-top: var(--arrow-head) solid transparent;
    border-bottom: var(--arrow-head) solid transparent;
  }

  .flow-list--zigzag .flow-item:last-child::before,
  .flow-list--zigzag .flow-item:last-child::after {
    content: none !important;
    display: none !important;
  }
}

@media (max-width: 767px) {
  .flow-list--zigzag {
    grid-template-columns: 1fr;
  }

  .flow-list--zigzag .flow-item {
    position: relative;
  }

  .flow-list--zigzag .flow-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    width: var(--arrow-thickness);
    height: calc(var(--flow-gap) - var(--arrow-head));
    background: var(--arrow-color);
  }

  .flow-list--zigzag .flow-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% + (var(--flow-gap) - var(--arrow-head)));
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: var(--arrow-head) solid var(--arrow-color);
    border-left: var(--arrow-head) solid transparent;
    border-right: var(--arrow-head) solid transparent;
  }
}

@media (max-width: 767px) {
  .flow-illust {
    margin-block: 0;
    min-height: 0;
  }

  /* ▼ここを小さめに変更 */
  .flow-illust img {
    width: clamp(56px, 16vw, 80px);
    margin: 1rem 0.6rem 0.3rem;
  }

  /* ▼先頭〜5件分の画像も少し小さくする */
  .flow-list .flow-item:nth-of-type(-n + 6) .flow-illust img {
    width: clamp(60px, 18vw, 90px);
  }

  .flow-list .flow-item:nth-of-type(-n + 6) {
    display: flow-root;
    text-align: left;
    --flow-text-max: 100%;
  }

  .flow-list .flow-item:nth-of-type(-n + 6) .flow-illust {
    float: left;
    display: block;
    margin: 0 0.6rem 0.2rem 0;
  }

  .flow-list .flow-item:nth-of-type(-n + 6) .flow-text {
    margin-top: 1rem;
    max-width: var(--flow-text-max);
    white-space: normal;
  }

  .flow-list .flow-item:nth-of-type(n + 7) .flow-text {
    margin-top: 0.6rem;
    white-space: normal;
  }
}


/* -------------------------------------------------------
   個別画像サイズ調整（flow-img-large / flow-img-small）
   - !important を使わずに既存指定を上書き
   - figure に付けた場合と img に付けた場合の両方に対応
   ------------------------------------------------------- */

/* 大きめ画像（shioriicon.svg 用） */
.flow-img-large {
  width: 100%;
  max-width: 100%;
  margin-top: 0.8rem;
  margin-bottom: 0;
  display: flex;
  justify-content: center;
}

/* figure.flow-img-large 内の画像、または img.flow-img-large に適用 */
.flow-img-large img,
.flow-illust img.flow-img-large {
  width: min(300px, 100%);
  height: auto;
}

/* 小さめ画像（manwithcellphone.svg など） */
.flow-img-small {
  width: auto;
  max-width: 60%;
  margin: 0;
  display: inline-flex;
  justify-content: center;
}

/* figure.flow-img-small 内の画像、または img.flow-img-small に適用 */
.flow-img-small img,
.flow-illust img.flow-img-small {
  width: clamp(80px, 16vw, 120px);
  margin: 1rem 1rem 0rem;
  height: auto;
}

/* スマホ時のバランス微調整（左右画像を少し小さめに） */
@media (max-width: 600px) {
  .flow-img-large img,
  .flow-illust img.flow-img-large {
    width: min(230px, 90%);
  }

  /* ▼ここをさらに小さめに変更 */
  .flow-img-small img,
  .flow-illust img.flow-img-small {
    width: clamp(56px, 18vw, 80px);
    margin: 1.6rem 1rem 0.8rem;
  }
}

@media (max-width: 767px) {
  /* flow-img-small を使っているステップ（3・6番）のみ、
     メイン画像の右側に小さい画像が並ぶように調整 */
  .flow-list .flow-item:nth-of-type(3) .flow-illust,
  .flow-list .flow-item:nth-of-type(4) .flow-illust,
  .flow-list .flow-item:nth-of-type(6) .flow-illust {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .flow-list .flow-item:nth-of-type(3) .flow-illust img:not(.flow-img-small),
  .flow-list .flow-item:nth-of-type(4) .flow-illust img:not(.flow-img-small),
  .flow-list .flow-item:nth-of-type(6) .flow-illust img:not(.flow-img-small) {
    order: 1;
  }

  .flow-list .flow-item:nth-of-type(3) .flow-illust img.flow-img-small,
  .flow-list .flow-item:nth-of-type(4) .flow-illust img.flow-img-small,
  .flow-list .flow-item:nth-of-type(6) .flow-illust img.flow-img-small {
    order: 2;
    margin-left: 0.6rem;
  }
}

