:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #22262b;
  --muted: #5f6670;
  --line: #e2dfd7;
  --accent: #2f6b4f;
  --accent-text: #ffffff;
  --accent-soft: #e6f0ea;
  --warn: #9a4b12;
  --warn-soft: #fbefe3;
  --danger: #a3262a;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181b;
    --surface: #1e2226;
    --text: #e8e9ea;
    --muted: #a1a8b0;
    --line: #33393f;
    --accent: #6fbf95;
    --accent-text: #0f1a14;
    --accent-soft: #1f3329;
    --warn: #f0b27a;
    --warn-soft: #3a2a1c;
    --danger: #f08a8d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181b; --surface: #1e2226; --text: #e8e9ea; --muted: #a1a8b0; --line: #33393f;
  --accent: #6fbf95; --accent-text: #0f1a14; --accent-soft: #1f3329; --warn: #f0b27a; --warn-soft: #3a2a1c;
  --danger: #f08a8d; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }

/* 上の帯 */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top .in {
  max-width: 1040px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; margin-right: auto; }
.brand small { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: .5em; }
.who { color: var(--muted); font-size: .9rem; }

main { max-width: 1040px; margin: 0 auto; padding: 28px 16px 64px; }
main.narrow { max-width: 520px; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
footer .in { max-width: 1040px; margin: 0 auto; padding: 20px 16px; display: flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1.2em; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: .3em .8em; font-size: .85rem; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }

/* トップ */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
.hero p.lead { font-size: 1.08rem; color: var(--muted); max-width: 40em; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
a.card.link { display: block; color: inherit; text-decoration: none; border-color: var(--accent); }
a.card.link:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
a.card.link h3 { color: var(--accent); }
a.card.link h3::after { content: " →"; }
a.card.link.dl h3::after { content: " ⤓"; }
.card .sub { color: var(--muted); font-size: .8rem; }
.section { margin-top: 48px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: s; position: relative; padding: 14px 16px 14px 56px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; display: grid; place-items: center; font-size: .9rem;
}
.tag { display: inline-block; font-size: .75rem; padding: .05em .6em; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag.soon { background: var(--warn-soft); color: var(--warn); }
.tag.off { background: var(--line); color: var(--muted); }

/* フォーム */
form.box, .box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 4px; }
label .opt { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: .4em; }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
  width: 100%; font: inherit; padding: .6em .7em; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 6em; resize: vertical; }
.check { display: flex; gap: .5em; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .45em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.msg { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: .92rem; display: none; }
.msg.show { display: block; }
.msg.err { background: var(--warn-soft); color: var(--warn); }
.msg.ok { background: var(--accent-soft); color: var(--accent); }

/* 一覧（管理画面） */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  font: inherit; background: none; border: 0; padding: .6em 1em; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: .75rem; text-align: center; margin-left: .3em; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: .82rem; }
td.acts { white-space: nowrap; }
td.acts .btn { margin: 2px 0; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.linkbox { word-break: break-all; background: var(--bg); border: 1px dashed var(--line); padding: 8px; border-radius: 6px; font-size: .85rem; }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 24px; width: min(520px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0,0,0,.4); }

.prose { max-width: 46em; }
.prose h2 { margin-top: 1.8em; }
.prose ol, .prose ul { padding-left: 1.4em; }

@media (max-width: 600px) {
  main { padding-top: 20px; }
  form.box, .box { padding: 18px; }
  .hero { padding-top: 16px; }
}
