:root {
  --bg: #fff7f3;
  --card: #ffffff;
  --text: #3b3340;
  --sub: #8a7f8f;
  --line: #f1e4df;
  --primary: #ee7b7b;
  --primary-ink: #ffffff;
  --soft: #fdeceb;
  --ok: #4daa8a;
  --warn: #e0a030;
  --danger: #d9534f;
  --shadow: 0 2px 10px rgba(120, 70, 70, 0.08);
  --radius: 18px;
  --tab-h: 64px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #13111a;
  --card: #1e1b27;
  --text: #ebe7f1;
  --sub: #9d96aa;
  --line: #2e2a3a;
  --primary: #e58a8a;
  --primary-ink: #1a1220;
  --soft: #2a2230;
  --ok: #5cc2a0;
  --warn: #e3b04e;
  --danger: #ea7b77;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
body.sheet-open { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.child-chip {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; text-align: left; box-shadow: var(--shadow);
}
.child-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.child-chip .names { min-width: 0; line-height: 1.25; }
.child-chip .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.child-chip .age { font-size: 12.5px; color: var(--sub); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(0.94); }

main#view { padding: 4px 14px 0; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card h2, .section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-title small { font-weight: 400; color: var(--sub); }
.muted { color: var(--sub); font-size: 13.5px; }
.empty { text-align: center; color: var(--sub); padding: 18px 8px; font-size: 14px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: 560px; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--sub); font-size: 11px; padding: 0; }
.tabbar button i { font-size: 19px; }
.tabbar button[aria-current='page'] { color: var(--primary); font-weight: 700; }

/* ---------- buttons / forms ---------- */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 16px; min-height: 48px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.soft { background: var(--soft); border-color: transparent; color: var(--primary); }
.btn.danger { color: var(--danger); }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.link-btn { border: 0; background: none; color: var(--primary); font-weight: 600; padding: 6px 4px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span, .field-label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; font-weight: 600; }
.input, input[type='text'], input[type='number'], input[type='date'], input[type='datetime-local'], textarea, select {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; min-height: 48px; outline: none;
}
.input:focus, input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 72px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 64px; min-height: 48px; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 10px; font-weight: 600; }
.seg button[aria-pressed='true'] { background: var(--soft); border-color: var(--primary); color: var(--primary); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg); font-size: 22px; font-weight: 700; flex: none; }
.stepper .val { flex: 1; text-align: center; font-size: 34px; font-weight: 800; line-height: 1.1; }
.stepper .val small { font-size: 15px; font-weight: 600; color: var(--sub); margin-left: 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chips button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; min-height: 40px; font-weight: 600; }
.chips button:active { background: var(--soft); }

.notice { border-radius: 12px; padding: 10px 12px; font-size: 13.5px; background: var(--soft); margin-bottom: 14px; }
.notice.warn { background: color-mix(in srgb, var(--warn) 18%, var(--card)); }
.notice.danger { background: color-mix(in srgb, var(--danger) 16%, var(--card)); }
.error-text { color: var(--danger); font-size: 13.5px; margin: 6px 0 10px; min-height: 1px; }

/* ---------- home ---------- */
.hero { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.since-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.since { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.since .lbl { font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.since .big { font-size: 22px; font-weight: 800; margin-top: 2px; line-height: 1.25; }
.since .sub { font-size: 12.5px; color: var(--sub); }

.timer-card { display: flex; align-items: center; gap: 12px; border: 2px solid var(--primary); background: var(--soft); border-radius: 16px; padding: 12px; }
.timer-card + .timer-card { margin-top: 8px; }
.timer-card .tc-body { flex: 1; min-width: 0; }
.timer-card .tc-title { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.timer-card .tc-time { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.timer-card .btn { min-height: 52px; }

.quick-main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-sub { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.qbtn {
  border: 1px solid var(--line); background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 92px; font-weight: 700; font-size: 14.5px; padding: 8px 4px;
}
.qbtn:active { transform: scale(0.96); }
.qbtn .qi { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 20px; }
.quick-sub .qbtn { min-height: 74px; font-size: 12.5px; }
.quick-sub .qbtn .qi { width: 34px; height: 34px; font-size: 15px; }
.qbtn[data-active='true'] { border: 2px solid var(--primary); background: var(--soft); }

.today-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; text-align: center; }
.today-stats .n { font-size: 20px; font-weight: 800; line-height: 1.2; }
.today-stats .n small { font-size: 11px; font-weight: 600; color: var(--sub); }
.today-stats .l { font-size: 11.5px; color: var(--sub); }

/* ---------- log rows ---------- */
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; min-height: 56px; }
.log-row:last-child { border-bottom: 0; }
.log-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; font-size: 16px; }
.log-main { flex: 1; min-width: 0; }
.log-title { font-weight: 700; }
.log-sub { font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }

.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-nav .day-label { font-weight: 800; font-size: 17px; text-align: center; flex: 1; }
.day-nav .icon-btn { box-shadow: none; }

.fab { position: fixed; right: max(16px, calc(50% - 280px + 16px)); bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 25; height: 56px; border-radius: 999px; padding: 0 22px; border: 0; background: var(--primary); color: var(--primary-ink); font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); display: flex; align-items: center; gap: 8px; }

/* ---------- stats / charts ---------- */
.chart-box { position: relative; height: 190px; }
.avg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.avg-grid .n { font-size: 20px; font-weight: 800; }
.avg-grid .l { font-size: 12px; color: var(--sub); }

/* ---------- vaccines ---------- */
.vac-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; min-height: 60px; }
.vac-row:last-child { border-bottom: 0; }
.vac-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.vac-row[data-done='true'] .vac-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.vac-main { flex: 1; min-width: 0; }
.vac-name { font-weight: 700; }
.vac-sub { font-size: 12.5px; color: var(--sub); }
.badge { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--soft); color: var(--primary); white-space: nowrap; flex: none; }
.badge.now { background: color-mix(in srgb, var(--ok) 20%, var(--card)); color: var(--ok); }
.badge.late { background: color-mix(in srgb, var(--danger) 18%, var(--card)); color: var(--danger); }
.badge.opt { background: var(--bg); color: var(--sub); border: 1px solid var(--line); }
details.fold > summary { cursor: pointer; font-weight: 700; padding: 4px 0; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 6, 16, 0.5); z-index: 50; animation: fade 0.15s ease-out; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 51;
  width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  animation: up 0.2s ease-out;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.sheet-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.sheet-head .icon-btn { box-shadow: none; }
.sheet-body { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; top: calc(10px + env(safe-area-inset-top)); z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { pointer-events: auto; background: #3b3340; color: #fff; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); max-width: 520px; animation: fade 0.15s ease-out; }
:root[data-theme='dark'] .toast { background: #ebe7f1; color: #1a1220; }
.toast button { border: 0; background: none; color: #ffb4b4; font-weight: 800; padding: 4px 6px; }
:root[data-theme='dark'] .toast button { color: #b3392f; }

/* ---------- onboarding ---------- */
.onboard { max-width: 520px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.onboard .logo { width: 84px; height: 84px; border-radius: 26px; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-size: 40px; margin: 0 auto; }
.onboard h1 { text-align: center; font-size: 26px; }
.onboard .lead { text-align: center; color: var(--sub); }
.feature-list { list-style: none; margin: 0; padding: 16px 18px; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.feature-list i { color: var(--primary); margin-top: 4px; width: 18px; text-align: center; }
.code-box { font-size: 30px; font-weight: 800; letter-spacing: 0.18em; text-align: center; background: var(--soft); border-radius: 14px; padding: 14px 8px; font-variant-numeric: tabular-nums; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.member-list li:last-child { border-bottom: 0; }
.disclaimer { font-size: 12px; color: var(--sub); line-height: 1.6; }

.skeleton { height: 90px; border-radius: 16px; background: linear-gradient(90deg, var(--line), var(--card), var(--line)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- percentile / workload / foods / diary ---------- */
.pct { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--primary); background: var(--soft); border-radius: 999px; padding: 0 8px; margin-left: 4px; }
.legend-note { font-size: 12px; color: var(--sub); margin-top: 8px; }
.wl-row { margin-bottom: 14px; }
.wl-row:last-child { margin-bottom: 0; }
.wl-head { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.wl-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
.wl-bar span { display: block; height: 100%; }
.wl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; color: var(--sub); }
.wl-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.chip-group-title { font-size: 12.5px; color: var(--sub); font-weight: 700; margin: 12px 0 2px; }
.allergen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.allergen { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--bg); font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.allergen[data-done='true'] { border-color: var(--ok); }
.allergen small { color: var(--sub); font-size: 11.5px; }
.badge.mild { background: color-mix(in srgb, var(--warn) 22%, var(--card)); color: var(--warn); }
.badge.severe { background: color-mix(in srgb, var(--danger) 18%, var(--card)); color: var(--danger); }

.diary-card { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; padding: 0; }
.diary-card img, .diary-card .photo-missing { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line); }
img[data-photo]:not([src]) { visibility: hidden; }
.diary-body { display: block; padding: 12px 14px 14px; }
.diary-meta { font-size: 12.5px; color: var(--sub); display: flex; gap: 8px; align-items: center; }
.diary-text { display: block; margin-top: 6px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.photo-missing { display: grid; place-items: center; color: var(--sub); font-size: 13px; min-height: 120px; }
.photo-full { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; background: var(--line); margin-bottom: 14px; display: block; }
.photo-pick { position: relative; overflow: hidden; }
.photo-pick input[type='file'] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.photo-preview { width: 100%; max-height: 40vh; object-fit: contain; border-radius: 12px; background: var(--line); margin-top: 10px; display: block; }

/* ---------- 思い出コメント ---------- */
.diary-comments { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.diary-comments-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; color: var(--text); }
.diary-comments-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.diary-comment-item { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13.5px; }
.diary-comment-head { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--sub); margin-bottom: 4px; }
.diary-comment-meta { display: flex; align-items: center; gap: 8px; }
.diary-comment-author { font-weight: 600; color: var(--text); }
.diary-comment-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; color: var(--text); }
.diary-comment-del { background: none; border: none; color: var(--sub); padding: 2px 5px; cursor: pointer; font-size: 12px; border-radius: 4px; }
.diary-comment-del:hover { color: var(--danger); }
.diary-comment-form { display: flex; gap: 8px; align-items: flex-end; }
.diary-comment-form textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 8px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); resize: none; line-height: 1.4; box-sizing: border-box; }
.diary-comment-form button { flex-shrink: 0; }


/* ---------- 受診用まとめ(画面表示と印刷) ---------- */
#report-root { display: none; }
#report-root.open { display: block; position: fixed; inset: 0; z-index: 80; background: #e9e6ea; overflow: auto; color: #222; }
.report-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: #fff; border-bottom: 1px solid #ddd; }
.report-bar .btn { flex: 1; background: #fff; color: #222; border-color: #ccc; }
.report-bar .btn.primary { background: #ee7b7b; color: #fff; border-color: transparent; }
.report-sheet { max-width: 780px; margin: 12px auto 40px; background: #fff; padding: 22px 20px; font-size: 14px; line-height: 1.6; }
.report-sheet h1 { font-size: 20px; margin-bottom: 2px; }
.report-sheet h2 { font-size: 15px; margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 2px solid #ee7b7b; }
.report-sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-sheet th, .report-sheet td { border: 1px solid #ccc; padding: 4px 8px; text-align: left; }
.report-sheet th { background: #f5f0f0; font-weight: 700; }
.report-sheet td.num, .report-sheet th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-sheet .rp-meta { color: #555; font-size: 12.5px; }
.report-sheet .rp-hot { font-weight: 800; color: #c0392b; }
.report-sheet .rp-note { font-size: 11.5px; color: #666; margin-top: 18px; }
.report-sheet .rp-empty { color: #777; font-size: 13px; }
@media print {
  body.report-open #app, body.report-open #sheet-root, body.report-open #toast-root { display: none !important; }
  #report-root.open { position: static; overflow: visible; background: #fff; }
  .report-bar, .report-days { display: none !important; }
  .report-sheet { margin: 0; padding: 0; max-width: none; }
  .report-sheet h2 { break-after: avoid; }
  .report-sheet table { break-inside: auto; }
  .report-sheet tr { break-inside: avoid; }
  @page { margin: 14mm; }
}

/* ---------- 声・文章で記録 ---------- */
.voice-btn { width: 100%; margin-top: 12px; min-height: 52px; border: 1.5px dashed var(--primary); background: var(--soft); color: var(--primary); border-radius: 14px; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.voice-btn:active { transform: scale(0.98); }
#voice-root { text-align: center; }
.voice-lead { font-weight: 700; margin: 4px 0 6px; }
.voice-eg { font-size: 13px; margin: 0 0 14px; }
.voice-mic { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 38px; display: grid; place-items: center; margin: 10px auto 8px; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 40%, transparent); }
.voice-mic.rec { background: var(--danger); animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); } 50% { box-shadow: 0 0 0 16px transparent; } }
@media (prefers-reduced-motion: reduce) { .voice-mic.rec { animation: none; } }
.voice-hint { margin: 0 0 16px; color: var(--sub); font-variant-numeric: tabular-nums; }
.voice-note { font-size: 12px; margin: 12px 0 0; text-align: left; }
.voice-wait { padding: 36px 0; color: var(--sub); }
.voice-wait i { font-size: 32px; color: var(--primary); margin-bottom: 12px; }
.voice-tr { text-align: left; background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--sub); margin-bottom: 12px; }
.cand-list { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-bottom: 10px; }
.cand { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--card); }
.cand-head { display: flex; align-items: center; gap: 10px; }
.cand-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cand-t small { color: var(--sub); font-size: 12.5px; }
.cand-edit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cand-f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--sub); flex: 1 1 140px; }
.cand-f input { min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--bg); color: var(--text); font-size: 15px; min-width: 0; }
.cand-f input { min-height: 40px; font-size: 14.5px; }
.cand-f { flex: 1 1 150px; }
.cand { padding: 8px 10px; }
.voice-actions { position: sticky; bottom: 0; background: var(--card); padding: 6px 0 2px; margin-top: 4px; box-shadow: 0 -8px 8px -4px var(--card); }
.voice-actions .error-text { margin: 0 0 6px; }
.voice-actions { bottom: calc(-20px - env(safe-area-inset-bottom)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ---------- onboarding: 入口の選択 ---------- */
.ob-q { text-align: center; font-size: 17px; margin: 4px 0 -6px; }
.ob-choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); min-height: 84px; }
.ob-choice:active { transform: scale(0.98); background: var(--soft); }
.ob-choice .ob-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-size: 20px; }
.ob-choice .ob-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ob-choice .ob-tx b { font-size: 16.5px; }
.ob-choice .ob-tx small { color: var(--sub); font-size: 12.5px; line-height: 1.5; }
.ob-choice .ob-ar { color: var(--sub); }
.ob-back { align-self: flex-start; margin-bottom: -6px; }
.onboard .notice { margin-bottom: 0; line-height: 1.6; }

/* ---------- 日付・日時入力: iOS Safari で他の入力欄より広く/高さが違って見える問題の対策 ---------- */
input[type='date'], input[type='datetime-local'], input[type='time'], input[type='month'] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-width: 0; max-width: 100%;
  box-sizing: border-box; margin: 0; text-align: left;
  line-height: 1.4; min-height: 48px;
}
input[type='date']::-webkit-date-and-time-value, input[type='datetime-local']::-webkit-date-and-time-value {
  text-align: left; min-height: 1.4em; margin: 0; padding: 0;
}
input[type='date']::-webkit-datetime-edit, input[type='datetime-local']::-webkit-datetime-edit { padding: 0; }
input[type='date']::-webkit-inner-spin-button, input[type='datetime-local']::-webkit-inner-spin-button { display: none; }
/* カレンダーのアイコンは右端に小さく(Chromium系)。iOS ではタップで標準のピッカーが開く */
input[type='date']::-webkit-calendar-picker-indicator, input[type='datetime-local']::-webkit-calendar-picker-indicator { margin: 0 0 0 6px; padding: 0; }
label.field, .cand-f { min-width: 0; }
.cand-f input { width: 100%; }

/* ---------- 補助・手続き ---------- */
select#pref-select { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); padding: 8px 12px; font-size: 16px; }
.sub-list { padding-bottom: 8px; }
.sub-item { border-top: 1px solid var(--line); padding: 8px 0; }
.sub-item:first-of-type { border-top: 0; }
.sub-item > summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; list-style-position: outside; }
.sub-item > summary .sub-t { flex: 1 1 60%; min-width: 0; }
.sub-body { padding: 4px 2px 8px; font-size: 14px; line-height: 1.7; }
.sub-row { margin: 0 0 8px; }
.sub-row b { display: block; font-size: 12px; color: var(--sub); }
.sub-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.sub-links .link-btn { text-align: left; text-decoration: none; }
.sub-hint { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 2px; min-height: 52px; }
.sub-hint-t { flex: 1; font-size: 14px; line-height: 1.5; }
.sub-hint .qi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }

/* 申請済みのチェック */
.sub-check { flex: none; width: 36px; height: 36px; margin: -4px 0 -4px -6px; padding: 0; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sub-check i { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); background: var(--card); color: transparent; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; transition: background 0.12s, border-color 0.12s; }
.sub-check.on i { background: var(--ok); border-color: var(--ok); color: #fff; }
.sub-item.is-done .sub-t { color: var(--sub); text-decoration: line-through; text-decoration-thickness: 1px; }
.sub-done-row { margin: 10px 0 8px; }
.sub-done-row .btn { width: 100%; }
.sub-progress { margin: 8px 0 0; font-size: 13px; color: var(--text); }
.sub-bar { display: block; height: 6px; border-radius: 999px; background: var(--line); margin-top: 6px; overflow: hidden; }
.sub-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
