:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #182337;
  --muted: #697589;
  --line: #dce3ed;
  --navy: #17365d;
  --blue: #2f6fed;
  --blue-dark: #2258c5;
  --blue-soft: #eaf1ff;
  --green: #247a64;
  --green-soft: #e7f5f0;
  --shadow: 0 18px 55px rgba(32, 55, 86, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Sans", Meiryo, system-ui, sans-serif;
}
button, textarea, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 10px max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(220, 227, 237, 0.9);
  background: rgba(245, 247, 251, 0.94);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: .98rem;
  font-weight: 900;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
}
.header-nav { display: flex; gap: 22px; margin-left: auto; }
.header-nav a { color: #536176; font-size: .82rem; font-weight: 700; text-decoration: none; }
.privacy-badge, .usage-count {
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}
.privacy-badge { padding: 7px 10px; background: var(--green-soft); color: var(--green); }

main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 64px;
  align-items: center;
  min-height: 520px;
  padding: 70px 0 66px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 20px;
  color: var(--navy);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.15;
  letter-spacing: -.04em;
}
.hero-copy > p:not(.eyebrow) { max-width: 600px; color: var(--muted); line-height: 1.9; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-points span {
  padding: 8px 12px;
  border: 1px solid #cad8f6;
  border-radius: 999px;
  background: var(--surface);
  color: #38557d;
  font-size: .76rem;
  font-weight: 800;
}
.hero-visual { display: grid; place-items: center; }
.mail-window {
  position: relative;
  width: min(390px, 100%);
  padding: 65px 36px 38px;
  border: 1px solid #cad6e7;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(34, 67, 114, .16);
  transform: rotate(2deg);
}
.mail-window-top {
  position: absolute; inset: 0 0 auto;
  display: flex; gap: 7px; padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.mail-window-top i { width: 9px; height: 9px; border-radius: 50%; background: #cdd6e2; }
.mail-line { height: 10px; margin-bottom: 17px; border-radius: 10px; background: #e8edf4; }
.mail-line.short { width: 42%; background: #b9c9df; }
.mail-line.medium { width: 72%; }
.mail-stamp {
  position: absolute; right: -18px; bottom: -22px;
  padding: 13px 20px; border-radius: 10px;
  background: var(--blue); color: #fff;
  font-size: .82rem; font-weight: 900;
  box-shadow: 0 14px 28px rgba(47, 111, 237, .28);
}

.tool-frame-section { margin-bottom: 42px; }
.frame-privacy-note {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 18px; border: 1px solid #bddfd5; border-bottom: 0;
  border-radius: 12px 12px 0 0; background: var(--green-soft); color: #286b5a;
}
.frame-privacy-note strong { font-size: .82rem; }
.frame-privacy-note span { font-size: .72rem; }
.tool-frame {
  display: block; width: 100%; height: 1000px;
  border: 1px solid var(--line); border-radius: 0 0 12px 12px; background: var(--bg);
}

.embedded-tool main { width: min(1060px, calc(100% - 24px)); padding: 22px 0 10px; }
.generator-card, .result-section, .article-card, .steps > div, .policy-page {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.generator-card, .result-section { padding: 30px; }
.panel-heading, .result-heading, .result-label {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.panel-heading { margin-bottom: 28px; }
.panel-heading h2, .result-heading h2 { margin: 3px 0 0; color: var(--navy); }
.step-label { color: var(--blue); font-size: .68rem; font-weight: 900; letter-spacing: .1em; }
.usage-count { padding: 7px 10px; background: #eef2f7; color: var(--muted); }
fieldset { min-width: 0; padding: 0; border: 0; }
.field-group { display: grid; gap: 9px; margin: 0 0 22px; }
.field-label { color: var(--navy); font-size: .84rem; font-weight: 900; }
.field-label small { color: #8b96a7; font-weight: 500; }
.relation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.relation-grid label { cursor: pointer; }
.relation-grid input { position: absolute; opacity: 0; pointer-events: none; }
.relation-grid span {
  display: grid; gap: 3px; min-height: 70px; place-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  text-align: center; transition: .18s ease;
}
.relation-grid b { color: var(--navy); font-size: .86rem; }
.relation-grid small { color: var(--muted); font-size: .7rem; }
.relation-grid input:checked + span {
  border-color: var(--blue); background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.relation-grid input:focus-visible + span { outline: 3px solid rgba(47,111,237,.2); }
.sample-picker {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(340px, 1.3fr);
  gap: 22px;
  align-items: end;
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid #cddaf2;
  border-radius: 10px;
  background: #f5f8ff;
}
.sample-picker p { margin: 5px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.sample-picker-controls { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.sample-picker-controls .secondary-button { min-height: 48px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
select, textarea, input[type="text"] {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); outline: none;
}
select, input[type="text"] { min-height: 48px; padding: 0 13px; }
textarea { min-height: 180px; padding: 14px; resize: vertical; line-height: 1.75; }
select:focus, textarea:focus, input[type="text"]:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,111,237,.13);
}
textarea[aria-invalid="true"] { border-color: #d85757; }
.character-count { justify-self: end; color: #8a95a5; font-size: .72rem; }
.primary-button, .secondary-button, .copy-button {
  border: 0; border-radius: 9px; cursor: pointer; font-weight: 900;
}
.primary-button {
  width: 100%; min-height: 54px; padding: 0 22px;
  background: var(--blue); color: #fff; box-shadow: 0 10px 24px rgba(47,111,237,.22);
}
.primary-button:hover { background: var(--blue-dark); }
.secondary-button, .copy-button { padding: 9px 13px; background: var(--blue-soft); color: var(--blue-dark); }
.local-note, .result-note { margin: 13px 0 0; color: var(--muted); font-size: .72rem; text-align: center; }
.form-error { margin: 10px 0 0; color: #c34343; font-size: .8rem; font-weight: 700; text-align: center; }
.result-section { margin-top: 22px; }
.result-heading { margin-bottom: 24px; }
.result-field { margin-bottom: 20px; }
.result-label { margin-bottom: 8px; color: var(--navy); font-size: .82rem; font-weight: 900; }
.result-field textarea { min-height: 250px; }
.copy-button.copied, .primary-button.copied { background: var(--green); color: #fff; }
.copy-all { margin-top: 4px; }

.ad-slot {
  display: grid; place-items: center; min-height: 110px; padding: 20px;
  border: 1px dashed #c7cfda; border-radius: 10px; color: #8c96a4; text-align: center;
}
.ad-slot span { font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.ad-slot p { margin: 6px 0 0; font-size: .72rem; }
.ad-slot-wide { margin: 0 0 70px; }
.knowledge-section, .how-section { padding: 20px 0 76px; }
.section-heading { max-width: 650px; margin-bottom: 28px; }
.section-heading h2 { margin-bottom: 10px; color: var(--navy); font-size: clamp(1.7rem, 4vw, 2.5rem); }
.section-heading > p:last-child { color: var(--muted); line-height: 1.7; }
.article-grid, .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.article-card { display: block; padding: 24px; text-decoration: none; transition: transform .18s ease; }
.article-card:hover { transform: translateY(-3px); }
.article-card > span { color: var(--blue); font-size: .7rem; font-weight: 900; }
.article-card strong { display: block; margin: 9px 0 10px; color: var(--navy); line-height: 1.55; }
.article-card p, .steps p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.topic-links, .related-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.topic-links a, .related-links a {
  padding: 10px 13px; border: 1px solid #cad8f6; border-radius: 8px;
  background: #fff; color: var(--blue-dark); font-size: .78rem; font-weight: 800; text-decoration: none;
}
.seo-intro { padding: 0 0 76px; }
.seo-copy {
  max-width: 860px; padding: 28px; border-left: 4px solid var(--blue);
  border-radius: 0 10px 10px 0; background: #fff;
}
.seo-copy p { margin-bottom: 12px; color: var(--muted); line-height: 1.9; }
.seo-copy p:last-child { margin-bottom: 0; }
.steps > div { padding: 25px; box-shadow: none; }
.steps b { color: #9db7ed; font-size: 1.6rem; }
.steps strong { display: block; margin: 15px 0 8px; color: var(--navy); }

.site-footer {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  padding: 42px max(20px, calc((100vw - 1120px) / 2));
  border-top: 1px solid var(--line); background: #edf1f6;
}
.footer-brand { margin-bottom: 12px; }
.site-footer p, .site-footer small { color: var(--muted); font-size: .76rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 17px; align-content: center; }
.site-footer nav a { color: #59677a; font-size: .76rem; text-decoration: none; }
.site-footer small { grid-column: 1 / -1; }

.policy-page { max-width: 820px; margin: 54px auto 80px; padding: 42px; }
.policy-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.policy-page h2 { margin-top: 34px; color: var(--navy); font-size: 1.25rem; }
.policy-page p, .policy-page li { color: #586679; line-height: 1.9; }
.policy-page a { color: var(--blue); }
.content-page { max-width: 900px; }
.content-page .lead { color: #45566d; font-size: 1rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; color: var(--muted); font-size: .74rem; }
.breadcrumb a { text-decoration: none; }
.mail-example {
  margin: 16px 0 28px; padding: 22px; border: 1px solid #d4deed;
  border-radius: 10px; background: #f8faff;
}
.mail-example strong { display: block; margin-bottom: 14px; color: var(--navy); }
.mail-example p { margin: 0; white-space: normal; }
.cta-line { margin-top: 34px; }
.primary-link {
  display: inline-block; padding: 14px 20px; border-radius: 9px;
  background: var(--blue); color: #fff !important; font-weight: 900; text-decoration: none;
}

@media (max-width: 820px) {
  .header-nav { display: none; }
  .privacy-badge { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 36px; padding: 52px 0; }
  .hero-visual { padding: 0 18px; }
  .relation-grid { grid-template-columns: repeat(2, 1fr); }
  .sample-picker { grid-template-columns: 1fr; gap: 12px; }
  .article-grid, .steps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  main { width: min(100% - 20px, 1120px); }
  .site-header { min-height: 60px; padding: 9px 12px; }
  .brand { font-size: .84rem; }
  .brand-mark { width: 32px; height: 32px; }
  .privacy-badge { max-width: 130px; padding: 6px 8px; text-align: center; font-size: .62rem; }
  .hero { padding-top: 40px; }
  .hero-copy br { display: none; }
  .hero-visual { display: none; }
  .frame-privacy-note { display: grid; }
  .frame-privacy-note span { line-height: 1.5; }
  .tool-frame { height: 1280px; }
  .embedded-tool main { width: calc(100% - 14px); padding-top: 8px; }
  .generator-card, .result-section { padding: 18px 14px; border-radius: 9px; box-shadow: none; }
  .panel-heading, .result-heading { align-items: flex-start; }
  .panel-heading h2, .result-heading h2 { font-size: 1.25rem; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .sample-picker-controls { grid-template-columns: 1fr; }
  .relation-grid { gap: 7px; }
  .relation-grid span { min-height: 64px; }
  .result-heading { display: grid; }
  .result-heading .secondary-button { justify-self: start; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer nav { display: grid; gap: 12px; }
  .site-footer small { grid-column: auto; }
  .policy-page { margin: 30px auto 60px; padding: 25px 18px; }
}
.analytics-consent {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  width: min(420px, calc(100% - 40px));
  padding: 18px;
  border: 1px solid #d9e0eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(28, 39, 60, 0.18);
  color: #263247;
}

.analytics-consent p {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.7;
}

.analytics-consent div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.analytics-consent button {
  padding: 9px 14px;
  border: 1px solid #bdc8d8;
  border-radius: 8px;
  background: #fff;
  color: #263247;
  cursor: pointer;
}

.analytics-consent .analytics-consent-accept {
  border-color: #3157d5;
  background: #3157d5;
  color: #fff;
}
