:root {
  --cream: #f7f0df;
  --paper: #fffdf6;
  --ink: #213a34;
  --ink-soft: #5d6e68;
  --green: #176b58;
  --green-deep: #0e5748;
  --green-pale: #e4f1e9;
  --coral: #e5674d;
  --coral-pale: #fff0e8;
  --gold: #e4aa36;
  --line: #d9d1bb;
  --shadow: 0 18px 48px rgba(49, 58, 45, 0.14);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

/*
 * 目次から各カードへは、なめらかスクロールではなく一気に移動させる。
 * scroll-behavior: smooth は環境によって移動そのものが起きないことがあり、
 * 「押しても何も起きない」に見えるのを避ける。
 * ヘッダーに隠れないよう、飛び先には scroll-margin-top を必ず付ける。
 */
html {
  min-height: 100%;
  background: var(--cream);
}

/* スマートフォンだけで効かせる改行 */
.sp-only {
  display: inline;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(241, 190, 82, 0.24), transparent 24%),
    radial-gradient(circle at 88% 80%, rgba(53, 145, 112, 0.15), transparent 26%),
    var(--cream);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

a {
  color: inherit;
}

button,
a,
input,
textarea,
select {
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 4px solid rgba(229, 103, 77, 0.35);
  outline-offset: 3px;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
  background: rgba(255, 253, 246, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

/* ヘッダー */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid rgba(217, 209, 187, 0.72);
  background: rgba(255, 253, 246, 0.96);
  backdrop-filter: blur(10px);
}

/* サイト内の移動は上部左端に置く（part1 と同じ作法） */
.home-button {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 66px;
  height: 44px;
  border: 1px solid #b9cfc4;
  border-radius: 14px;
  color: var(--green-deep);
  background: var(--green-pale);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(23, 107, 88, 0.09);
}

.home-button span:first-child {
  font-size: 18px;
  line-height: 1;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-copy p,
.brand-copy strong {
  margin: 0;
}

.brand-copy p {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-copy strong {
  display: block;
  margin-top: 1px;
  font-size: 15px;
}

main {
  padding: 0 20px 40px;
}

/* 導入 */

.hero {
  padding: 34px 2px 22px;
}

.eyebrow {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid #bcd6c9;
  border-radius: 999px;
  color: var(--green-deep);
  background: var(--green-pale);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

h1,
h2 {
  color: var(--ink);
  font-weight: 900;
  letter-spacing: -0.035em;
}

h1 {
  margin: 15px 0 12px;
  font-size: clamp(30px, 8.4vw, 46px);
  line-height: 1.3;
}

h1 em {
  color: var(--coral);
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: rgba(229, 103, 77, 0.24);
  text-decoration-thickness: 8px;
  text-underline-offset: -3px;
}

.lead {
  max-width: 560px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

/* LINEへの誘い */

.line-invite {
  padding: 18px;
  border: 1px solid #bcd6c9;
  border-radius: 20px;
  background: var(--green-pale);
}

.line-invite strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green-deep);
  font-size: 15px;
}

.line-invite p {
  margin: 0;
  color: #4a625a;
  font-size: 12px;
  line-height: 1.9;
}

/*
 * オープンチャットへの参加リンクは、意図して置いていない。
 * このページは誰でも開けるため、招待URLを載せると
 * 対象外の人が参加できてしまう。参加案内は当日のQRだけで行う。
 */

/* 目次 */

.toc {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(205, 196, 172, 0.9);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(46, 63, 50, 0.08);
  scroll-margin-top: 90px;
}

.toc h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

/* 押せることが分かるように、見出しへ添える一言 */
.toc h2 span {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.toc ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 14px 10px 10px;
  border: 1px solid #e2dbc7;
  border-radius: 15px;
  background: #fffdf6;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.toc a:active {
  background: var(--green-pale);
}

.toc a span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 16px;
  font-weight: 900;
}

/* 使う前の注意 */

.safety-note {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid #efc59f;
  border-radius: 20px;
  background: var(--coral-pale);
}

.safety-list {
  display: grid;
  gap: 5px;
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
}

.safety-list li {
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #8f4732;
  font-size: 12px;
  font-weight: 700;
}

.safety-list li::before {
  content: "×";
  margin-right: 8px;
  font-weight: 900;
}

.safety-note strong {
  display: block;
  margin-bottom: 6px;
  color: #a2472f;
  font-size: 13px;
}

.safety-note p {
  margin: 0 0 10px;
  color: #6d574f;
  font-size: 12px;
  line-height: 1.9;
}

.safety-note p:last-child {
  margin-bottom: 0;
}

.safety-sub {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid rgba(239, 197, 159, 0.8);
  font-size: 11px !important;
}

.basics {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed #b9cfc4;
  border-radius: 20px;
  background: rgba(228, 241, 233, 0.74);
}

.basics h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.basics-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.basics-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.basics-list span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.basics-list b {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.basics-note {
  margin: 12px 0 0;
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 700;
}

/* カード */

.recipe-list {
  display: grid;
  gap: 20px;
  margin-top: 26px;
}

.recipe {
  overflow: hidden;
  padding: 22px 18px 20px;
  border: 1px solid rgba(205, 196, 172, 0.9);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(46, 63, 50, 0.1);
  scroll-margin-top: 90px;
}

.recipe-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0 0 8px;
  border-radius: 50%;
  color: #fff;
  background: var(--coral);
  font-size: 16px;
  font-weight: 900;
}

.recipe h2 {
  margin: 4px 0 14px;
  font-size: clamp(21px, 5.6vw, 27px);
  line-height: 1.4;
}

.recipe-meta {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border-radius: 16px;
  background: #f7f4ea;
}

.recipe-meta div {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 8px;
}

.recipe-meta dt {
  color: var(--green-deep);
  font-size: 11px;
  font-weight: 900;
}

.recipe-meta dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

/* タブ */

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 17px;
  background: #f0ebdc;
}

.mode-switch button {
  min-height: 48px;
  border: 0;
  border-radius: 13px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-switch button[aria-selected="true"] {
  color: #fff;
  background: var(--green);
  box-shadow: 0 5px 13px rgba(23, 107, 88, 0.22);
}

.mode-panel {
  padding-top: 18px;
}

.mode-panel[hidden] {
  display: none;
}

.panel-guide {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

/* 文章の箱 */

.text-box {
  position: relative;
  margin: 0 0 14px;
  border: 2px solid #b9cfc4;
  border-radius: 20px;
  background: #fff;
  box-shadow: inset 0 0 0 5px #eef5f0, 0 10px 28px rgba(35, 62, 52, 0.1);
}

.text-box::before {
  content: "AIに送る文章";
  position: absolute;
  top: -12px;
  left: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.result-box {
  border-color: #f0c3b4;
  box-shadow: inset 0 0 0 5px #fdf2ed, 0 10px 28px rgba(120, 60, 45, 0.1);
}

.result-box::before {
  content: "できあがった文章";
  background: var(--coral);
}

.text-box pre {
  margin: 0;
  overflow-x: auto;
  padding: 24px 18px 18px;
  color: #253b35;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.95;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(180deg, #238069, var(--green));
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 0 var(--green-deep), 0 15px 30px rgba(23, 107, 88, 0.24);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.copy-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 var(--green-deep), 0 8px 18px rgba(23, 107, 88, 0.18);
}

.copy-button.is-copied {
  background: linear-gradient(180deg, #e7775f, var(--coral));
  box-shadow: 0 8px 0 #ad4733, 0 15px 30px rgba(229, 103, 77, 0.2);
}

.copy-icon {
  font-size: 19px;
}

/* 入力欄 */

.field-list {
  display: grid;
  gap: 15px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #ddd6c2;
  border-radius: 14px;
  color: var(--ink);
  background: #fffdf6;
  font-size: 16px;
  line-height: 1.7;
}

.field input,
.field select {
  min-height: 52px;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%),
    linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--green);
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b3aa96;
}

.field-hint {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.field-caution {
  margin: 14px 0 16px;
  padding: 10px 13px;
  border-radius: 13px;
  color: #a2472f;
  background: var(--coral-pale);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.build-button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--coral);
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 -4px 0 rgba(124, 48, 33, 0.18);
  cursor: pointer;
}

.build-button:active {
  transform: translateY(2px);
}

.result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.result[hidden] {
  display: none;
}

/* 締め */

.closing {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #f0d9a8;
  border-radius: 22px;
  background: #fff8e6;
}

.closing h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.closing p {
  margin: 0;
  color: #6b5c3c;
  font-size: 12px;
  line-height: 1.85;
}

.back-to-toc {
  display: block;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

footer {
  padding: 20px 22px calc(20px + var(--safe-bottom));
  border-top: 1px solid rgba(217, 209, 187, 0.72);
  color: var(--ink-soft);
  background: rgba(255, 253, 246, 0.94);
  font-size: 10px;
  text-align: center;
}

footer p {
  margin: 0;
}

/* コピー通知 */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: min(calc(100% - 36px), 420px);
  padding: 12px 15px;
  transform: translateX(-50%);
  border-radius: 16px;
  color: #fff;
  background: rgba(27, 60, 50, 0.96);
  box-shadow: 0 14px 35px rgba(24, 49, 42, 0.32);
  animation: toast-in 0.25s ease both;
}

.toast[hidden] {
  display: none;
}

.toast > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--green-deep);
  background: #d8f5e7;
  font-weight: 900;
}

.toast strong,
.toast small {
  display: block;
}

.toast strong {
  font-size: 13px;
}

.toast small {
  margin-top: 2px;
  color: #dce8e3;
  font-size: 10px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@media (min-width: 761px) {
  .sp-only {
    display: none;
  }

  body {
    padding: 24px 0;
  }

  .site-shell {
    min-height: calc(100dvh - 48px);
    border-radius: 30px;
  }

  .site-header {
    border-radius: 30px 30px 0 0;
  }

  main {
    padding-right: 34px;
    padding-left: 34px;
  }

  .recipe {
    padding: 28px 26px 24px;
  }
}

@media (max-width: 390px) {
  main {
    padding-right: 15px;
    padding-left: 15px;
  }

  .recipe {
    padding-right: 15px;
    padding-left: 15px;
  }

  .recipe-meta div {
    grid-template-columns: 4.8rem 1fr;
  }

  .mode-switch button {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
