:root {
  --navy: #102a43;
  --blue: #1d5f91;
  --blue-dark: #16496f;
  --ink: #1f2933;
  --muted: #52606d;
  --line: #cbd2d9;
  --pale: #f3f6f8;
  --white: #ffffff;
  --accent: #d9eaf5;
  --content: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
img { max-width: 100%; }
.wrap { width: min(var(--content), calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--white); padding: 8px 16px; }
.skip-link:focus { left: 8px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--navy); text-decoration: none; font-size: 23px; font-weight: 700; letter-spacing: .03em; line-height: 1.25; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.menu-toggle { display: none; border: 1px solid var(--navy); background: var(--white); color: var(--navy); padding: 10px 14px; min-height: 44px; font: inherit; cursor: pointer; }
.main-nav ul { display: flex; align-items: center; gap: 22px; padding: 0; margin: 0; list-style: none; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue); }

.hero { background: var(--pale); border-bottom: 4px solid var(--blue); padding: 84px 0 76px; }
.eyebrow { margin: 0 0 14px; color: var(--blue-dark); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { color: var(--navy); line-height: 1.45; }
h1 { max-width: 800px; margin: 0; font-size: clamp(31px, 5vw, 52px); letter-spacing: .03em; }
.hero-lead { max-width: 690px; margin: 24px 0 0; font-size: 18px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-block; min-width: 180px; border: 1px solid var(--blue-dark); padding: 11px 20px; color: var(--white); background: var(--blue-dark); text-align: center; text-decoration: none; font-weight: 700; }
.button:hover { color: var(--white); background: var(--navy); }
.button-outline { color: var(--blue-dark); background: var(--white); }
.button-outline:hover { color: var(--white); background: var(--blue-dark); }

.section { padding: 72px 0; }
.section-alt { background: var(--pale); }
.section-heading { max-width: 730px; margin: 0 0 34px; }
.section-heading h2 { margin: 0; font-size: 28px; }
.section-heading p { margin: 12px 0 0; color: var(--muted); }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); background: var(--white); padding: 30px; }
.card h3 { margin: 0 0 10px; font-size: 21px; }
.card p { margin: 0 0 16px; }
.card p:last-child { margin-bottom: 0; }
.card-number { display: block; margin-bottom: 14px; color: var(--blue); font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.notice { border-left: 4px solid var(--blue); background: var(--accent); padding: 18px 22px; }
.notice p { margin: 0; }
.process { counter-reset: flow; list-style: none; padding: 0; margin: 0; }
.process li { position: relative; padding: 0 0 30px 48px; }
.process li::before { counter-increment: flow; content: counter(flow, decimal-leading-zero); position: absolute; top: 0; left: 0; color: var(--blue-dark); font-weight: 700; }
.process li:not(:last-child)::after { position: absolute; top: 33px; bottom: 0; left: 12px; border-left: 1px solid var(--line); content: ""; }
.process h3 { margin: 0 0 5px; font-size: 18px; }
.process p { margin: 0; color: var(--muted); }

.page-title { background: var(--pale); border-bottom: 1px solid var(--line); padding: 54px 0; }
.page-title h1 { font-size: clamp(28px, 4vw, 40px); }
.page-title p { max-width: 710px; margin: 14px 0 0; color: var(--muted); }
.content { padding: 60px 0 80px; }
.content-inner { max-width: 840px; }
.content h2 { margin: 48px 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--navy); font-size: 25px; }
.content h2:first-child { margin-top: 0; }
.content h3 { margin: 28px 0 8px; font-size: 19px; }
.content p { margin: 0 0 18px; }
.content ul { margin: 0 0 20px; padding-left: 1.4em; }
.content li { margin-bottom: 5px; }
.info-table { width: 100%; border-collapse: collapse; margin: 22px 0; }
.info-table th, .info-table td { border: 1px solid var(--line); padding: 14px 16px; text-align: left; vertical-align: top; }
.info-table th { width: 30%; background: var(--pale); color: var(--navy); font-weight: 700; }
.contact-panel { border: 1px solid var(--navy); padding: 32px; background: var(--white); }
.contact-panel h2 { margin-top: 0; }
.contact-panel a { font-size: 19px; font-weight: 700; }

/* お問い合わせフォーム */
.contact-form { margin-top: 24px; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 700; }
.field .req { display: inline-block; margin-left: 6px; border-radius: 2px; background: var(--navy); padding: 1px 6px; color: var(--white); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: #b42318; background: #fff6f5; }
.field-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.field-inline { display: flex; align-items: flex-start; gap: 10px; }
.field-inline input { width: 20px; height: 20px; margin: 4px 0 0; flex: 0 0 auto; }
.field-inline label { margin: 0; font-weight: 400; }
.field-inline label a { font-size: inherit; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-slot { margin: 24px 0 20px; }
.turnstile-slot:empty { margin: 0; }
.form-submit { width: 100%; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 14px 20px; }
.form-submit:disabled { opacity: .6; cursor: progress; }
.form-status { margin: 16px 0 0; font-weight: 700; }
.form-status:empty { display: none; }
.form-status.is-success { padding: 14px 16px; border-left: 4px solid #0f7b3f; background: #eef8f1; color: #0f5f31; }
.form-status.is-error { padding: 14px 16px; border-left: 4px solid #b42318; background: #fff1f0; color: #8d1a12; }

.site-footer { border-top: 1px solid var(--line); background: #f8fafc; padding: 44px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 2fr; gap: 44px; }
.footer-title { margin: 0 0 8px; color: var(--navy); font-weight: 700; }
.footer-text { margin: 0; color: var(--muted); font-size: 14px; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.footer-nav a { font-size: 14px; }
.related { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.related span { letter-spacing: .08em; }
.copyright { margin: 36px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* 無料ツール */
.tool-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 32px; }
.tool-card { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--white); padding: 24px; color: inherit; text-decoration: none; }
.tool-card:hover { border-color: var(--blue); background: var(--pale); }
.tool-card-eyebrow { color: var(--blue-dark); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tool-card h2 { margin: 8px 0 10px; padding: 0; border: 0; font-size: 20px; }
.tool-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.tool-card-more { margin-top: auto; color: var(--blue-dark); font-size: 14px; font-weight: 700; }
.tool-card:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.tool-panel { border: 1px solid var(--line); background: var(--pale); padding: 26px; }
.tool-field { margin: 0 0 20px; }
.tool-field > label { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 700; }
.tool-field textarea,
.tool-field input[type="text"],
.tool-field input[type="number"],
.tool-field input[type="datetime-local"],
.tool-field input[type="file"],
.tool-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}
.tool-field textarea { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 14px; line-height: 1.6; resize: vertical; }
.tool-field input[type="file"] { padding: 8px; }
.tool-field select { max-width: 320px; }
.tool-field input[type="range"] { width: 100%; max-width: 360px; accent-color: var(--blue-dark); }
.tool-field input[type="color"] { width: 100%; max-width: 320px; min-height: 48px; border: 1px solid var(--line); background: var(--white); padding: 4px; font: inherit; }
.tool-field textarea:focus,
.tool-field input:focus,
.tool-field select:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
.tool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-button { min-height: 44px; border: 1px solid var(--blue-dark); background: var(--blue-dark); color: var(--white); padding: 10px 20px; font: inherit; font-weight: 700; cursor: pointer; }
.tool-button:hover:not(:disabled) { background: var(--navy); }
.tool-button.is-secondary { background: var(--white); color: var(--blue-dark); }
.tool-button.is-secondary:hover:not(:disabled) { background: var(--accent); }
.tool-button:disabled { opacity: .5; cursor: not-allowed; }
.tool-status { margin: 16px 0 0; font-weight: 700; }
.tool-status:empty { display: none; }
.tool-status.is-success { padding: 10px 14px; border-left: 4px solid #0f7b3f; background: #eef8f1; color: #0f5f31; }
.tool-status.is-error { padding: 10px 14px; border-left: 4px solid #b42318; background: #fff1f0; color: #8d1a12; }
.tool-meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.tool-meta:empty { display: none; }
.tool-note { border-left: 4px solid var(--blue); background: var(--accent); padding: 16px 20px; }
.tool-note p { margin: 0; font-size: 14px; }
.tool-preview { display: flex; justify-content: center; margin: 22px 0 0; padding: 18px; border: 1px solid var(--line); background: var(--white); }
.tool-preview[hidden] { display: none; }
.tool-preview canvas,
.tool-preview img { max-width: 100%; height: auto; }
.tool-steps { margin: 0 0 20px; padding-left: 1.4em; }
.tool-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }
.tool-counts > div { border: 1px solid var(--line); background: var(--white); padding: 12px 14px; }
.tool-counts dt { color: var(--muted); font-size: 12px; }
.tool-counts dd { margin: 2px 0 0; color: var(--navy); font-size: 20px; font-weight: 700; line-height: 1.3; }
.tool-options { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--line); background: var(--white); }
.tool-options label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.tool-options input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue-dark); }
.tool-code { display: block; margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--line); background: var(--white); font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 19px; letter-spacing: .04em; word-break: break-all; }
.tool-result { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--line); background: var(--white); font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 14px; line-height: 1.7; white-space: pre-line; word-break: break-all; }
.tool-result:empty { display: none; }
.tool-block + .tool-block { margin-top: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.tool-block h3 { margin: 0 0 14px; font-size: 18px; }
.tool-swatch { min-height: 120px; }

/* トップページのツール導線 */
.hero-note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.tool-banner { display: grid; grid-template-columns: 1.7fr 1fr; gap: 32px; align-items: center; border: 1px solid var(--navy); background: var(--pale); padding: 32px; }
.tool-banner h2 { margin: 0; font-size: 26px; }
.tool-banner p { margin: 10px 0 0; color: var(--muted); }
.tool-banner .eyebrow { margin-bottom: 8px; }
.tool-banner-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tool-banner-links a { border: 1px solid var(--line); background: var(--white); padding: 6px 12px; font-size: 13px; text-decoration: none; }
.tool-banner-links a:hover { border-color: var(--blue); }
.tool-banner-actions .button { display: block; width: 100%; }

@media (max-width: 760px) {
  .wrap { width: min(var(--content), calc(100% - 32px)); }
  .header-inner { min-height: 68px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 68px; right: 16px; left: 16px; z-index: 10; border: 1px solid var(--line); background: var(--white); padding: 16px; }
  .main-nav.is-open { display: block; }
  .main-nav ul { display: block; }
  .main-nav li + li { border-top: 1px solid #e6e9ed; }
  .main-nav a { display: block; padding: 10px 4px; }
  .card > a { display: inline-block; padding: 6px 0; }
  .footer-nav a { display: block; padding: 10px 0; }
  .hero { padding: 60px 0 56px; }
  .hero-lead { font-size: 16px; }
  .section { padding: 54px 0; }
  .grid-2, .footer-grid { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: 1fr; }
  .info-table th, .info-table td { display: block; width: 100%; }
  .info-table th { border-bottom: 0; }
  .info-table td { border-top: 0; }
  .tool-cards, .tool-row { grid-template-columns: 1fr; }
  .tool-panel { padding: 20px 16px; }
  .tool-actions .tool-button { flex: 1 1 100%; }
  .tool-banner { grid-template-columns: 1fr; padding: 24px 18px; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
