:root {
  --bg: #f7f8f6;
  --panel: #fff;
  --ink: #1f2933;
  --muted: #65717d;
  --line: #d7dde3;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --success: #087443;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
a { color: inherit; text-decoration: none; }
input, textarea, button { font: inherit; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.brand { display: inline-flex; align-items: center; min-height: 40px; }
.brand img { display: block; width: 168px; height: 40px; }
nav { display: flex; gap: 14px; color: var(--muted); font-size: 14px; }
.main { padding: 34px 0 56px; }
.main > section + section { margin-top: 34px; }
.hero, .result-hero { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; margin-bottom: 22px; }
.hero.compact { padding: 24px; }
.portal-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 28px; align-items: center; padding: 38px 0 28px; }
.portal-hero-copy h1 { max-width: 760px; font-size: clamp(34px, 6vw, 56px); }
.portal-hero-copy p { max-width: 720px; font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.portal-hero-panel { border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; padding: 24px; box-shadow: 0 14px 34px rgba(31, 41, 51, .08); }
.portal-hero-panel img { display: block; width: 168px; height: 40px; margin-bottom: 18px; }
.portal-hero-panel ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.portal-hero-panel li { margin: 0; }
.portal-hero-panel a { position: relative; display: block; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 14px 44px 14px 14px; color: var(--muted); line-height: 1.6; box-shadow: 0 8px 18px rgba(31, 41, 51, .06); transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.portal-hero-panel a::after { content: "→"; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 20px; font-weight: 900; }
.portal-hero-panel a:hover { border-color: var(--accent); background: #f4fbf9; box-shadow: 0 12px 24px rgba(15, 118, 110, .12); transform: translateY(-1px); }
.portal-hero-panel a:focus-visible { outline: 3px solid #b7e4dc; outline-offset: 2px; }
.portal-hero-panel a span { display: block; color: var(--ink); font-weight: 800; }
.intro-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; margin-bottom: 0; }
.intro-band h2 { margin-bottom: 6px; }
.intro-band p { margin: 0; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 800; font-size: 13px; }
h1 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 42px); line-height: 1.2; letter-spacing: 0; }
h2 { margin: 0 0 14px; font-size: 22px; }
h3 { margin: 0 0 10px; font-size: 19px; }
p { line-height: 1.75; }
.ad-note, .small { color: var(--muted); font-size: 13px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-title.compact { margin: 0 0 12px; }
.section-title.compact h3 { margin: 0; }
.category-list { display: grid; gap: 34px; }
.category-block { display: grid; gap: 12px; }
#diagnoses { margin-bottom: 42px; }
.card-grid, .offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tool-card, .offer-card, .content-block, .diagnosis-form { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; }
.tool-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tool-card-title h3 { margin: 0; }
.tool-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 8px; background: #e7f3f1; color: var(--accent-dark); font-weight: 900; font-size: 18px; }
.tool-card p:not(.tag) { flex: 1; }
.tool-card .button { margin-top: auto; }
.tag { display: inline-block; margin: 0 0 12px; background: #e7f3f1; color: var(--accent-dark); padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: white; padding: 10px 16px; font-weight: 800; cursor: pointer; }
.button.secondary { background: white; color: var(--ink); border-color: var(--line); }
.button:hover { background: var(--accent-dark); }
.button.secondary:hover { background: #f1f5f9; }
.notice { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 14px; }
.notice.danger { border-color: #f3b5ad; color: var(--danger); background: #fff7f6; }
.notice.success { border-color: #a9dec5; color: var(--success); background: #f2fbf6; }
.progress { display: grid; gap: 8px; margin-bottom: 20px; color: var(--muted); font-weight: 700; }
.progress div { height: 8px; background: #e8edf1; border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 160ms ease; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.help { color: var(--muted); margin-top: 0; }
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.choice small { display: block; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.form-error { color: var(--danger); font-weight: 700; }
.diagnosis-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(31, 41, 51, .56); backdrop-filter: blur(4px); }
.diagnosis-overlay-panel { width: min(480px, 100%); border: 1px solid var(--line); border-radius: 8px; background: white; padding: 28px; text-align: center; box-shadow: 0 18px 40px rgba(31, 41, 51, .22); }
.diagnosis-overlay-panel h2 { margin-bottom: 8px; }
.diagnosis-overlay-panel p:last-child { margin-bottom: 0; color: var(--muted); }
.diagnosis-spinner { width: 42px; height: 42px; margin: 0 auto 16px; border: 4px solid #d9eee9; border-top-color: var(--accent); border-radius: 50%; animation: spin 900ms linear infinite; }
.offer-description { margin: 0 0 12px; color: var(--muted); line-height: 1.75; }
.offer-description > *:first-child { margin-top: 0; }
.offer-description > *:last-child { margin-bottom: 0; }
.offer-description img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.offer-description a { color: var(--accent-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.offer-card ul { padding-left: 20px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 22px 0; background: var(--panel); font-size: 13px; }
.narrow { max-width: 560px; }
label { display: grid; gap: 6px; font-weight: 700; margin-bottom: 12px; }
label.check { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: white; }
select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: white; font: inherit; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.admin-nav a { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 8px 12px; font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 20px 0; }
.metric { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metric span { color: var(--muted); display: block; font-size: 13px; }
.metric strong { display: block; font-size: 28px; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
.form-grid, .table-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.admin-list { display: grid; gap: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.info-grid article { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; padding: 16px; }
.info-grid h3 { font-size: 16px; margin-bottom: 6px; }
.info-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.key-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fbfcfd; }
.key-card code { display: inline-block; margin-bottom: 8px; color: var(--accent-dark); font-weight: 800; }
.key-card strong { display: block; margin-bottom: 6px; }
.key-card p { margin: 0; color: var(--muted); font-size: 13px; }
.design-detail { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.design-detail summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px; cursor: pointer; font-weight: 800; background: #f8fafc; }
.design-detail table { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .header-inner, .section-title, .intro-band { align-items: flex-start; flex-direction: column; }
  nav { flex-wrap: wrap; }
  .portal-hero { grid-template-columns: 1fr; padding-top: 24px; }
  .portal-hero-copy p { font-size: 16px; }
  .hero, .result-hero, .content-block, .diagnosis-form { padding: 18px; }
}
