:root {
  --bg: #F7F1E6;
  --text: #3B2A1E;
  --accent: #B5462B;
  --green: #2F5D46;
  --card-bg: #FFFFFF;
  --border: #E3D8C4;
  --muted: #8A7A65;
  --soft: #FBF6EC;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 48px; overflow-wrap: anywhere; }

header.intro { margin-bottom: 18px; }
header.intro .signature { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
header.intro h1 { font-size: 22px; line-height: 1.5; margin: 0 0 10px; }
header.intro .lead { font-size: 13.5px; line-height: 1.7; margin: 0; }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px; margin-bottom: 20px; box-shadow: 0 2px 6px rgba(59, 42, 30, 0.06);
}
.card h2 { font-size: 17px; line-height: 1.5; margin: 0 0 12px; }

/* 入力 */
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.field legend, .legend-like { display: block; font-size: 14.5px; padding: 0; margin-bottom: 8px; line-height: 1.5; }
.field { margin-bottom: 18px; }
.row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.row select { flex: 1; min-width: 0; }
select {
  font: inherit; font-size: 17px; padding: 11px 10px; min-height: 48px; width: 100%;
  border: 1px solid var(--border); border-radius: 10px; background: #FFFDF9; color: var(--text);
}
.inline-label { display: block; width: 100%; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
select:focus, input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.seg { display: flex; gap: 8px; }
.seg.two { flex-wrap: wrap; }
.seg label { flex: 1 1 0; min-width: 0; position: relative; }
.seg.two label { flex: 1 1 calc(50% - 4px); }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: block; text-align: center; padding: 12px 6px; min-height: 48px; line-height: 1.5;
  border: 1px solid var(--border); border-radius: 10px; background: #FFFDF9; font-size: 15px;
}
.seg input:checked + span { background: var(--green); border-color: var(--green); color: #FFFFFF; font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.input-row { display: flex; align-items: center; gap: 8px; }
input[type="text"] {
  flex: 1; min-width: 0; width: 100%; font-size: 17px; padding: 12px; min-height: 48px;
  border: 1px solid var(--border); border-radius: 10px; background: #FFFDF9; color: var(--text);
}
.unit { font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.error { font-size: 12.5px; color: var(--accent); margin-top: 4px; min-height: 16px; }
.mini-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; }

/* 結果 */
.sub-label { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; }
.big { font-size: 30px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.big small { font-size: 14px; font-weight: 400; color: var(--muted); display: block; margin-top: 2px; }
.detail { font-size: 13.5px; line-height: 1.7; margin: 8px 0 0; }
.msg { font-size: 15px; line-height: 1.7; margin: 0; }

ul.bars { list-style: none; margin: 0; padding: 0; }
ul.bars li { margin-bottom: 14px; }
ul.bars li:last-child { margin-bottom: 0; }
.bar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.bar-head .v { font-weight: 700; white-space: nowrap; }
.bar-track { height: 16px; background: var(--soft); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--green); border-radius: 7px; }
.bar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 前提・出典 */
.notes { margin: 0 0 20px; }
.notes h2 { font-size: 15px; margin: 18px 0 8px; }
.notes ul { margin: 0; padding-left: 1.3em; font-size: 13px; line-height: 1.8; }
.notes p { font-size: 13px; line-height: 1.8; margin: 0; }
.provisional { color: var(--accent); margin-top: 6px !important; }

.follow-box {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 16px; margin-bottom: 20px; text-align: center; box-shadow: 0 2px 6px rgba(59, 42, 30, 0.06);
}
.follow-line { font-size: 14.5px; line-height: 1.7; margin: 0 0 10px; }
.follow-btn {
  display: inline-block; margin-top: 6px; padding: 14px 28px; background: var(--accent); color: #FFFFFF;
  font-size: 15.5px; font-weight: 700; text-decoration: none; border-radius: 999px;
}
footer { margin-top: 24px; }
.disclaimer { font-size: 11.5px; color: var(--muted); line-height: 1.7; border-top: 1px solid var(--border); padding-top: 14px; margin: 0; }
