.content-top-hero--rule { --content-top-hero-bg: #faefdd; --content-top-hero-title-outline: #4a4a4a; }
.rule-tool-page {
  --rule-orange: #de7300;
  /*--rule-orange: #a85b00;*/
  --rule-pink: #ed3f70;
  --rule-teal: #128172;
  --rule-navy: #192897;
  --rule-status-red: #b00000;
  --rule-calendar-pink: #d61f5c;
  --rule-muted: #6f6f6f;
  --rule-step-1: #c2433e;
  --rule-step-2: #c52f14;
  --rule-step-3: #ce3f0b;
  --rule-step-4: #a76500;
  color: #23252c;
  background: #fff;
}

.rule-tool-page .section-container {
  width: min(calc(100% - 40px), 1200px);
}

.rule-tool-hero__visual--family {
  --float-duration: 5.2s;
  --float-delay: -1.2s;
  --float-distance: -11px;
  bottom: 35px;
  left: 20px;
  width: clamp(170px, 20vw, 280px);
}

.rule-tool-hero__visual--sheet {
  --float-duration: 6s;
  --float-delay: -3.1s;
  --float-distance: -15px;
  bottom: 5px;
  left: 15%;
  width: clamp(100px, 9vw, 130px);
}

.rule-tool-hero__visual--books {
  --float-duration: 5.7s;
  --float-delay: -2.3s;
  --float-distance: -13px;
  right: 20px;
  bottom: 20px;
  width: clamp(190px, 22vw, 310px);
}

@media (min-width: 1100px) {
  /* Anchor the illustrations to the central 1280px, rather than viewport edges. */
  .rule-tool-hero__visual--family { left: max(20px, calc(50% - 640px)); }
  .rule-tool-hero__visual--sheet { left: max(15%, calc(50% - 430px)); }
  .rule-tool-hero__visual--books { right: max(20px, calc(50% - 640px)); }
}

.rule-tool-heading,
.rule-tool-section-title {
  text-align: center;
}

.rule-tool-heading h2,
.rule-tool-section-title h2 {
  margin: 0;
  font-size: clamp(1.875rem, 3vw, 2.75rem);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.rule-tool-heading h2 span,
.rule-tool-section-title h2 span {
  color: var(--rule-orange);
}

.rule-tool-section-title h2::after {
  display: block;
  width: 58px;
  height: 10px;
  margin: 12px auto 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 58 10'%3E%3Cpath d='M1 5c4-7 8 7 12 0s8 7 12 0 8 7 12 0 8 7 12 0' fill='none' stroke='%23f1be28' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  content: "";
}

.rule-tool-section-title p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

.rule-tool-about {
  padding: 25px 0 75px;
  background-color: #fff;
  background-image: linear-gradient(rgb(25 40 150 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(25 40 150 / 5%) 1px, transparent 1px);
  background-size: 28px 28px;
}

.rule-tool-heading {
  position: relative;
  margin-bottom: 30px;
}

.rule-tool-heading a {
  position: absolute;
  right: 0;
  bottom: 0;
  color: #555;
  font-size: 0.75rem;
  font-weight: 700;
  text-underline-offset: 4px;
}

.rule-tool-about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.rule-tool-about__grid article {
  min-width: 0;
  text-align: center;
}

.rule-tool-about__grid h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 -12px;
  padding: 18px 16px;
  color: #fff;
  background: var(--rule-orange);
  border-radius: 8px;
  font-size: 1.25rem;
}

.rule-tool-about__grid h3::after {
  position: absolute;
  bottom: -13px;
  left: 50%;
  border: 14px solid transparent;
  border-top-color: var(--rule-orange);
  border-bottom: 0;
  content: "";
  transform: translateX(-50%);
}

.rule-tool-about__grid article > div {
  display: grid;
  min-height: 250px;
  padding: 25px 15px 15px;
  grid-template-columns: 46% 1fr;
  align-items: center;
  background: rgb(250 239 221 / 78%);
  border-radius: 50%;
}

.rule-tool-about__grid img {
  width: 100%;
  height: 190px;
  object-fit: contain;
}

.rule-tool-about__grid p {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.9;
  text-align: left;
}

.rule-tool-saved {
  padding: 65px 0 75px;
  background-color: #fffaf1;
  background-image: repeating-linear-gradient(45deg, rgb(235 127 0 / 7%) 0, rgb(235 127 0 / 7%) 13px, transparent 13px, transparent 31px);
}

.rule-tool-saved__grid {
  display: grid;
  margin-top: 40px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.saved-rule-card {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 25px;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rule-orange);
  border-radius: 22px;
  box-shadow: 0 5px 18px rgb(104 75 31 / 10%);
}

.saved-rule-card__delete {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 7px;
  place-items: center;
  background: #fff;
  border: 1px solid var(--rule-orange);
  border-radius: 8px;
  cursor: pointer;
}

.saved-rule-card__delete:hover { background: #fff2d8; }
.saved-rule-card__delete:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.saved-rule-card__delete img { display: block; width: 24px; height: 24px; }

.saved-rule-card h3 {
  margin: 0;
  padding-right: 50px;
  color: var(--rule-orange);
  font-size: 1.125rem;
}
.saved-rule-card__status{
  background: #fcc;
  padding: 5px;
  color: var(--rule-status-red);
  font-weight: bold;
  text-align: center;
  font-size: 80%;
}

.saved-rule-card__audience {
  align-self: flex-start;
  margin: 8px 0 15px;
  padding: 3px 12px;
  background: #fff2d8;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.saved-rule-card__members {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.75rem;
}
.saved-rule-card__members p{
  margin-top: 0;
  font-weight: bold;
}
.saved-rule-card__members .child{
  width:calc(50% - 3px);
  background: #effdfb;
  padding: 5px 2%;
  border-radius: 10px;
}
.saved-rule-card__members .adult{
  width:calc(50% - 3px);
  background: #fff1f8;
  padding: 5px 2%;
  border-radius: 10px;
}
.saved-rule-card__members .other{
  width:100%;
  background: #eeeeee;
  padding: 5px 2%;
  border-radius: 10px;
}
.saved-rule-card__member {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.saved-rule-card__avatar {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background-color: #fff;
}

.saved-rule-card__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 区分別の全身画像から、顔が円の中央に収まる範囲を表示する。 */
.saved-rule-card__avatar img:is(
  [src$="/avator_lower001.png"],
  [src$="/avator_middle001.png"],
  [src$="/avator_high001.png"],
  [src$="/avator_adult001.png"]
) {
  position: absolute;
  top: var(--avatar-top, 4%);
  left: var(--avatar-left);
  width: var(--avatar-width);
  max-width: none;
  height: auto;
}

.saved-rule-card__avatar img[src$="/avator_lower001.png"] {
  --avatar-top: -66%;
  --avatar-left: -23%;
  --avatar-width: 118%;
}

.saved-rule-card__avatar img[src$="/avator_middle001.png"] {
  --avatar-left: -16%;
  --avatar-width: 121%;
}

.saved-rule-card__avatar img[src$="/avator_high001.png"] {
  --avatar-left: -26%;
  --avatar-width: 137%;
}

.saved-rule-card__avatar img[src$="/avator_adult001.png"] {
  --avatar-left: -29%;
  --avatar-width: 137%;
}

.saved-rule-card__member-button.modal-button {
  width: fit-content;
  min-height: 34px;
  margin: 10px 0 0;
  padding: 6px 10px;
  align-self: flex-start;
  gap: 5px;
  color: var(--rule-orange);
  border: 1px solid var(--rule-orange);
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.6875rem;
}

.saved-rule-card__member-button.modal-button:not(:disabled):hover {
  color: var(--rule-orange);
  box-shadow: none;
}

.saved-rule-card__member-button img {
  width: 16px;
  height: 16px;
  filter: invert(45%) sepia(96%) saturate(1007%) hue-rotate(352deg);
}

.saved-rule-card dl {
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px dashed var(--rule-orange);
  font-size: 0.75rem;
}

.saved-rule-card dl div {
  display: flex;
  gap: 10px;
}

.saved-rule-card dt { font-weight: 700; }
.saved-rule-card dd { margin: 0; }

.saved-rule-card__notice {
  display: flex;
  margin: 10px 0 15px;
  padding: 12px;
  align-items: flex-start;
  gap: 10px;
  background: #fff4dd;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: left;
}

.saved-rule-card__notice-icon {
  width: 25px;
  height: 25px;
  flex: none;
  filter: invert(45%) sepia(96%) saturate(1007%) hue-rotate(352deg);
}

.saved-rule-card__notice-icon--review {
  color: var(--rule-orange);
  filter: none;
  font-size: 1.75rem;
  line-height: 1;
}

.saved-rule-card__notice strong { color: var(--rule-orange); }
.saved-rule-card__notice p { margin: 5px 0 0; font-size: 0.6875rem; line-height: 1.7; }

.saved-rule-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.saved-rule-card__actions a,
.rule-tool-utility-card a,
.rule-tool-utility-card button,
.rule-tool-review-grid a,
.rule-tool-review-grid button {
  display: flex;
  min-height: 44px;
  padding: 9px 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--rule-orange);
  background: #fff;
  border: 2px solid var(--rule-orange);
  border-radius: 999px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.saved-rule-card__actions a:last-child {
  color: #fff;
  background: var(--rule-orange);
}

.saved-rule-card__recreate-link {
  display: inline-flex;
  margin-top: 12px;
  padding: 0;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--rule-orange);
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.saved-rule-card__recreate-link:hover { text-decoration: underline; }

/* STEP画面と同じ通知。モーダルを開いたままでも見えるよう、モーダルより上に重ねる。 */
.rule-toast { position: fixed; left: 50%; bottom: 28px; z-index: 1100; max-width: calc(100% - 40px); padding: 13px 22px; border-radius: 999px; background: #17364a; color: #fff; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: .25s; }
.rule-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.rule-tool-utility-grid {
  display: grid;
  width: min(100%, 790px);
  margin: 28px auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.rule-tool-utility-card {
  display: grid;
  min-width: 0;
  padding: 18px;
  grid-template-columns: 118px 1fr;
  align-items: center;
  gap: 15px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 5px 18px rgb(104 75 31 / 8%);
}

.rule-tool-utility-card > img {
  width: 100%;
  height: 125px;
  object-fit: contain;
}

.rule-tool-utility-card h3 {
  margin: 0 0 7px;
  font-size: 1.0625rem;
}

.rule-tool-utility-card p {
  margin: 0 0 12px;
  color: #555;
  font-size: 0.75rem;
  line-height: 1.7;
}

.rule-tool-utility-card a,
.rule-tool-utility-card button {
  width: 100%;
  color: var(--rule-teal);
  border-color: var(--rule-teal);
}

.rule-tool-review-grid {
  display: grid;
  margin-top: 25px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.rule-tool-review-grid article {
  position: relative;
  min-height: 250px;
  padding: 32px 220px 30px 35px;
  overflow: hidden;
  background: #fff;
  border-top: 14px solid var(--rule-orange);
  border-radius: 20px;
  box-shadow: 0 5px 18px rgb(104 75 31 / 8%);
}

.rule-tool-review-grid h3 {
  margin: 0 0 14px;
  color: var(--rule-orange);
  font-size: 1.125rem;
}

.rule-tool-review-grid p {
  margin: 0 0 22px;
  font-size: 0.75rem;
  line-height: 1.9;
}

.rule-tool-review-grid article > img {
  position: absolute;
  right: 10px;
  bottom: -25px;
  width: 210px;
  height: 210px;
  object-fit: contain;
}

.rule-tool-review-grid a {
  color: #fff;
  background: var(--rule-orange);
}

.rule-tool-review-grid article.rule-tool-review-grid__calendar {
  display: flex;
  padding: 32px 34px 24px;
  flex-direction: column;
  justify-content: center;
  border-top-color: #ea3f70;
  text-align: center;
}

.rule-tool-review-grid__calendar h3 {
  margin: 0;
  color: var(--rule-calendar-pink);
  font-size: 1.3125rem;
  line-height: 1.5;
}

.rule-tool-review-grid__calendar p {
  margin: 18px 0;
  font-size: 0.75rem;
  line-height: 1.8;
}

.rule-tool-review-grid__calendar > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rule-tool-review-grid__calendar button {
  min-height: 54px;
  padding: 8px 14px;
  gap: 10px;
  color: var(--rule-calendar-pink);
  border-color: #ea3f70;
  font-size: 0.6875rem;
  line-height: 1.45;
}

.rule-tool-review-grid__calendar small {
  display: block;
  margin-top: 14px;
  color: var(--rule-muted);
  font-size: 0.5625rem;
  line-height: 1.6;
  text-align: center;
}

.rule-tool-process {
  padding: 75px 0 50px;
}

.rule-tool-process__steps {
  display: grid;
  margin: 35px 0 0;
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
}

.rule-tool-process__steps li {
  position: relative;
  display: flex;
  min-height: 135px;
  padding: 22px 25px 18px 38px;
  flex-direction: column;
  color: #fff;
  background: var(--rule-step-1);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%, 22px 50%);
}

.rule-tool-process__steps li:first-child {
  padding-left: 18px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
}

.rule-tool-process__steps li:nth-child(2) { background: var(--rule-step-2); }
.rule-tool-process__steps li:nth-child(3) { background: var(--rule-step-3); }
.rule-tool-process__steps li:nth-child(4) { background: var(--rule-step-4); }
.rule-tool-process__steps li:nth-child(5) { background: var(--rule-step-5); }

.rule-tool-process__steps small,
.rule-tool-process__steps strong,
.rule-tool-process__steps span { display: block; }

.rule-tool-process__steps small { font-size: 0.6875rem; font-weight: 800; }
.rule-tool-process__steps strong { margin: 3px 0 8px; font-size: 1rem; }
.rule-tool-process__steps span { font-size: 0.625rem; font-weight: 700; line-height: 1.6; }

.rule-tool-start {
  padding: 60px 0 80px;
  background-color: #fff;
  background-image: linear-gradient(rgb(25 40 150 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(25 40 150 / 5%) 1px, transparent 1px);
  background-size: 28px 28px;
}

.rule-tool-start .audience-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 38px;
}

.rule-tool-tips {
  padding: 75px 0 80px;
}


@media (max-width: 1024px) {
  .rule-tool-hero__visual--family { left: 10px; width: 21vw; }
  .rule-tool-hero__visual--books { right: 10px; width: 21vw; }
  .rule-tool-hero__visual--sheet { left: 8%; width: 13vw; }
}

@media (max-width: 1000px) {
  .rule-tool-review-grid article { padding-right: 150px; }
  .rule-tool-review-grid article > img { width: 150px; }
  .rule-tool-process__steps span { display: none; }
}

@media (max-width: 767px) {
  .rule-tool-page .section-container { width: min(calc(100% - 28px), 1200px); }
  .saved-rule-card__delete { width: 44px; height: 44px; }
  .rule-tool-hero__visual--family { bottom: 35px; left: 3%; width: min(32vw, 180px); }
  .rule-tool-hero__visual--sheet { bottom: 5px; left: 40%; width: min(22vw, 105px); }
  .rule-tool-hero__visual--books { right: 3%; bottom: 35px; width: min(32vw, 180px); }

  .rule-tool-heading h2,
  .rule-tool-section-title h2 { font-size: 1.625rem; }

  .rule-tool-heading a { position: static; display: inline-block; margin-top: 12px; }
  .rule-tool-about { padding-bottom: 50px; }
  .rule-tool-about__grid { grid-template-columns: 1fr; gap: 22px; }
  .rule-tool-about__grid article > div { min-height: 205px; padding-inline: 25px; border-radius: 110px; }
  .rule-tool-about__grid img { height: 160px; }

  .rule-tool-saved { padding: 50px 0; }
  .rule-tool-saved__grid { grid-template-columns: 1fr; }
  .rule-tool-utility-grid,
  .rule-tool-review-grid { grid-template-columns: 1fr; }
  .rule-tool-review-grid article { min-height: 235px; }

  .rule-tool-process { padding: 55px 0 35px; }
  .rule-tool-process__steps { grid-template-columns: 1fr; gap: 7px; }
  .rule-tool-process__steps li,
  .rule-tool-process__steps li:first-child {
    min-height: auto;
    padding: 15px 20px;
    clip-path: none;
    border-radius: 8px;
  }
  .rule-tool-process__steps li::after {
    position: absolute;
    right: 18px;
    bottom: -8px;
    border: 8px solid transparent;
    border-top-color: currentcolor;
    border-bottom: 0;
    content: "";
  }
  .rule-tool-process__steps li:last-child::after { display: none; }
  .rule-tool-process__steps span { display: block; }

  .rule-tool-start { padding: 50px 0 60px; }
  .rule-tool-start .audience-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .rule-tool-start .audience-card { margin-top: 55px; }
  .rule-tool-start .audience-card__image { height: min(180px, 42vw); }
  .rule-tool-start .audience-card__description { padding: 14px 12px; }

  .rule-tool-tips { padding: 55px 0; }
}

@media (max-width: 480px) {
  .rule-tool-start .audience-grid { grid-template-columns: 1fr; }
  .rule-tool-utility-card { grid-template-columns: 88px 1fr; padding: 14px; }
  .rule-tool-utility-card > img { height: 95px; }
  .rule-tool-review-grid article { padding: 25px 115px 25px 22px; }
  .rule-tool-review-grid article > img { right: -12px; width: 125px; }
  .rule-tool-review-grid article.rule-tool-review-grid__calendar { padding: 25px 22px; }
  .rule-tool-review-grid__calendar > div { grid-template-columns: 1fr; }
  .saved-rule-card__actions { grid-template-columns: 1fr; }
}
