:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #22252a;
  --muted: #646a73;
  --line: #dedbd3;
  --accent: #1f6f5c;
  --accent-text: #ffffff;
  --legal: #8a3b12;
  --legal-bg: #fbe9dc;
  --conditional: #6b5300;
  --conditional-bg: #f8efc9;
  --recommended: #2c4f7c;
  --recommended-bg: #e3edf9;
  --warn-bg: #fdf1d6;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a { color: var(--accent); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.page-write { padding-bottom: 96px; }

h1 { font-size: 24px; line-height: 1.4; margin: 16px 0 8px; }
h2 { font-size: 18px; margin: 32px 0 8px; }
h3 { font-size: 17px; margin: 0 0 4px; }

.hero p { font-size: 16px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.crumb { font-size: 13px; color: var(--muted); margin: 0; }

.card-list, .item-list, .plain-list { list-style: none; margin: 0; padding: 0; }

.card, .item-row, .field, .record {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.card p, .item-row p { margin: 4px 0; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.button {
  display: inline-block;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-quiet { background: transparent; color: var(--accent); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 24px 0;
  font-size: 14px;
}

.notice h2 { margin-top: 0; font-size: 16px; }
.notice p { margin: 4px 0; }

.warning {
  background: var(--warn-bg);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
}

.legend { margin: 0; }
.legend dt { margin-top: 8px; }
.legend dd { margin: 2px 0 0; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-legal { background: var(--legal-bg); color: var(--legal); }
.badge-conditional { background: var(--conditional-bg); color: var(--conditional); }
.badge-recommended { background: var(--recommended-bg); color: var(--recommended); }
.badge-detail { background: #eeece6; color: var(--muted); }

.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.item-label { font-weight: 600; }

.condition { font-size: 13px; color: var(--conditional); margin: 4px 0; }
.why { font-size: 14px; }

.field details.why { margin: 4px 0 10px; color: var(--muted); }
.field details.why summary { cursor: pointer; font-size: 13px; }
.field details.why p { margin: 4px 0; }

.state { margin-left: auto; font-size: 12px; color: var(--muted); }
.field[data-state="filled"] .state { color: var(--accent); font-weight: 600; }
.field[data-state="filled"] { border-color: var(--accent); }

input[type="text"], input[type="date"], textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea { resize: vertical; }

input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.money { display: flex; align-items: center; gap: 8px; }
.money input { max-width: 220px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.other-input, .note-input { margin-top: 8px; }

.marks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.marks .chip { min-height: 32px; padding: 2px 12px; font-size: 13px; color: var(--muted); }
.marks .chip[aria-pressed="true"] { background: var(--muted); border-color: var(--muted); color: #fff; }

.detail-toggle { width: 100%; margin-top: 4px; }

.footer-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.footer-bar > * { max-width: 720px; }
#progress { font-size: 13px; }

.record h1 { margin-top: 4px; }
.record h2 { font-size: 16px; margin-top: 24px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.record-kind { margin: 0; font-size: 13px; color: var(--muted); }

.record-list { margin: 0; }
.record-list dt { margin-top: 10px; font-size: 13px; color: var(--muted); }
.record-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.plain-list li { padding: 2px 0; }
.record details { margin-top: 16px; font-size: 14px; color: var(--muted); }
.record details summary { cursor: pointer; }

@media (min-width: 760px) {
  .footer-bar { padding-left: calc((100vw - 720px) / 2 + 16px); padding-right: calc((100vw - 720px) / 2 + 16px); }
}

.site-nav { display: flex; align-items: center; gap: 16px; font-size: 14px; }

.axes { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0; }
.axes dt { color: var(--muted); font-size: 14px; }
.axes dd { margin: 0; font-weight: 600; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
}

.panel h2 { margin-top: 0; }

.link-form { display: flex; flex-wrap: wrap; gap: 8px; }
.link-form input { flex: 1 1 200px; }

.link-row { border-top: 1px solid var(--line); padding: 12px 0; }
.link-row:first-child { border-top: 0; }
.link-row .url { font-size: 13px; margin: 6px 0; }
.link-row.revoked { color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 2px solid var(--line); padding: 2px 0 12px 12px; }
.timeline time { display: block; font-size: 13px; color: var(--muted); }

.hash { font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; color: var(--muted); }

.record-card { display: block; color: inherit; text-decoration: none; }
.record-card h3 { color: var(--accent); }

.comment {
  margin: 6px 0 0;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.respond textarea { margin: 8px 0; }
.respond fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 8px 12px; }
.respond legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.check { display: block; padding: 4px 0; font-size: 15px; }
.check input { margin-right: 8px; }

@media print {
  .site-header, .no-print, .footer-bar { display: none !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .record, .panel { border: 0; padding: 0; }
  details > * { display: block; }
  /* 写しは枚数を抑える。項目名だけの一覧は2列に並べる。 */
  body { font-size: 10.5pt; line-height: 1.5; }
  h1 { font-size: 16pt; margin: 0 0 4pt; }
  .record h2, .panel h2 { font-size: 11.5pt; margin: 10pt 0 3pt; }
  .record-list { columns: 2; column-gap: 18pt; }
  .record-list dt { margin-top: 0; }
  .record-list dd { margin-bottom: 5pt; break-inside: avoid; }
  .plain-list { columns: 2; column-gap: 18pt; }
  .plain-list li { break-inside: avoid; padding: 0; }
  .notice { border: 0; border-top: 1px solid #999; border-radius: 0; margin: 8pt 0; padding: 4pt 0; font-size: 9.5pt; }
  .timeline li { padding-bottom: 4pt; break-inside: avoid; }
  .hash, .small { font-size: 8.5pt; }
  .panel { margin: 6pt 0; }
}


/* 初めて使う方が、選択→質問→自分の相談の順に進めるための表示。 */
select { width:100%; min-height:48px; padding:10px 12px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--surface); font:inherit; }
select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
label.item-label { display:block; margin-bottom:6px; }
.prepare-step { margin:24px 0; }
.prepare-step h2 { margin-top:24px; }
.topic-choice { display:flex; align-items:flex-start; gap:12px; padding:14px; margin:10px 0; border:1px solid var(--line); border-radius:10px; background:var(--surface); cursor:pointer; }
.topic-choice input { flex:none; width:21px; height:21px; margin:3px 0 0; accent-color:var(--accent); }
.topic-choice:has(input:checked) { border-color:var(--accent); background:#f1f7f3; }
.topic-question { display:block; font-size:15px; line-height:1.7; color:var(--muted); margin-top:4px; }
.optional-details { padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.optional-details summary { cursor:pointer; min-height:36px; display:list-item; }
.agenda-state { display:none; }
.preview-banner { padding:10px 16px; background:#fff3d6; color:#47391c; font-size:14px; line-height:1.6; }
.preview-banner a { white-space:nowrap; }
.warning[hidden] { display:none; }
#agenda-share { scroll-margin-top:20px; }
