/* テーマカラーは --accent（ボタン・選択中）と --accent2（見出しの帯のグラデーション）の2色。背景と淡い色は --accent から作る。
   「要注意」「停止」など危険を知らせる色は --alert に固定し、テーマで変えない。 */
:root {
  --accent: #0277c9; --accent2: #22b8e6;
  --card: #fff; --ink: #16202a; --muted: #5f6b76; --line: #dfe6ec;
  --alert: #d0213a; --ok: #1d7a46; --ok-soft: #e4f3ea; --warn: #9a5b00; --warn-soft: #fff3dc;
  --fs: 16px; --r: 14px;
}
[data-color="mint"] { --accent: #0f8a80; --accent2: #3cc8a8; }
[data-color="green"] { --accent: #15803d; --accent2: #7ccf3a; }
[data-color="orange"] { --accent: #d9480f; --accent2: #f7a721; }
[data-color="purple"] { --accent: #7c3aed; --accent2: #d26ae8; }
[data-color="navy"] { --accent: #14407e; --accent2: #f28a1e; } /* アイコンと同じネイビー×オレンジ */
/* スマホがダークモードでも、白を基調にした明るい画面で表示する */
:root { color-scheme: light; --bg: color-mix(in srgb, var(--accent) 4%, #fff); --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff); --link: var(--accent); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs)/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
#app { max-width: 640px; margin: 0 auto; padding: 12px 16px; }
h1 { font-size: 1.35rem; margin: .2em 0 .5em; } h2 { font-size: 1.12rem; margin: .2em 0 .6em; } h3 { font-size: .95rem; margin: 1em 0 .4em; color: var(--muted); }
p { margin: .4em 0; } a { color: var(--link); }
.small { font-size: .85rem; } .muted { color: var(--muted); } .pad { padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 12px; overflow: hidden; }
.card.pad { padding: 16px; }
label { display: block; margin: .6em 0; font-size: .9rem; color: var(--muted); }
label.row { display: flex; align-items: center; gap: 8px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
textarea { resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; } .row input { margin: 0; }
.grid2, .grid3 { display: grid; gap: 8px; } .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--alert); border-color: var(--alert); }
.btn.done { color: var(--ok); border-color: var(--ok); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin: 6px 0; }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; color: var(--link); font: inherit; padding: 4px 0; cursor: pointer; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 36px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chips, .cats, .kids { display: flex; flex-wrap: wrap; gap: 6px; }
.cats { margin-bottom: 8px; } .kids { margin: 0 0 12px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { flex: 1; min-height: 44px; border: 0; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; } .seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.seg.wide { margin-bottom: 12px; } .seg.sm button { min-height: 34px; font-size: .82rem; padding: 0 6px; }
.rpe { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rpe button { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.rpe button.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 12px 14px; border-radius: var(--r); background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff; } .top > div { flex: 1; }
.top .muted { color: #ffffffd9; } .top .chip { background: #ffffff2e; color: #fff; border-color: #ffffff80; }
.team { font-weight: 800; font-size: 1.05rem; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs button { flex: 1; min-height: 60px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; position: relative; cursor: pointer; }
.tabs button.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.dot { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--alert); color: #fff; font-size: .75rem; align-items: center; justify-content: center; margin-left: 6px; }

.note { border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: .9rem; }
.note.ok { background: var(--ok-soft); color: var(--ok); } .note.warn { background: var(--warn-soft); color: var(--warn); }
.note .chip { margin-left: 8px; }
.hero { text-align: center; padding: 32px 0 12px; } img.logo { display: block; object-fit: cover; box-shadow: 0 6px 18px #0002; } .logo { width: 72px; height: 72px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 40px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 12px; }
.center { text-align: center; padding: 80px 0; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 12px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.code { font: 700 1.3rem/1.6 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; background: var(--bg); border: 2px dashed var(--accent); border-radius: 12px; padding: 14px; text-align: center; word-break: break-all; margin: 12px 0; }

.items { display: grid; gap: 8px; margin-top: 8px; }
.item { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.vals { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.stepper button { width: 34px; height: 34px; border: 0; background: none; color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.stepper span { min-width: 48px; text-align: center; font-size: .9rem; }
.x { border: 0; background: none; color: var(--muted); font-size: 1.3rem; width: 36px; height: 36px; cursor: pointer; }
.menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pick { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: .92rem; text-align: left; padding: 8px 12px; cursor: pointer; }
.painrow { display: grid; gap: 6px; margin: 8px 0; padding: 8px; background: var(--bg); border-radius: 12px; }

.date-h { font-weight: 800; margin: 16px 4px 6px; color: var(--muted); font-size: .9rem; }
.rec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.rec.flag { border-left: 4px solid var(--alert); }
.rec-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; } .rec-h .badge { margin-left: auto; }
.rec ul { margin: 6px 0; padding-left: 1.2em; }
.badge { font-size: .75rem; border-radius: 999px; padding: 2px 10px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.warn-t { color: var(--alert); font-weight: 600; }
.memo { background: var(--bg); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }
.cmt { font-size: .9rem; padding: 6px 10px; border-left: 3px solid var(--ok); margin: 6px 0; }
.li { display: flex; gap: 10px; align-items: center; width: 100%; padding: 14px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.li:first-child { border-top: 0; } .li b { margin-right: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; } th, td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: right; } th:first-child, td:first-child { text-align: left; } th { color: var(--muted); font-weight: 600; border-top: 0; }
.msgs { display: grid; gap: 8px; margin: 12px 0; }
.msg { max-width: 85%; background: var(--bg); border-radius: 14px; padding: 8px 12px; white-space: pre-wrap; } .msg.mine { justify-self: end; background: var(--accent-soft); }
.msg img, .msg video { max-width: 100%; border-radius: 10px; margin-top: 6px; display: block; }
.linkbox { margin-top: 12px; } .linkbox textarea { font-size: .8rem; }
#toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 12px; max-width: 90vw; z-index: 20; font-size: .92rem; }
.sheet-bg { position: fixed; inset: 0; background: #0006; z-index: 10; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); z-index: 11; max-width: 640px; margin: 0 auto; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; }
.sheet .doc { padding-bottom: 8px; }
body.is-busy { cursor: progress; } body.is-busy .btn.primary { opacity: .6; }
.demo-bar { background: var(--warn-soft); color: var(--warn); font-size: .85rem; text-align: center; padding: 6px 8px; }

.doc h2 { margin-top: 1.6em; } .consent { margin-top: 12px; } .consent .grid2 .btn { white-space: normal; font-size: .88rem; padding: 6px 8px; line-height: 1.3; } .agree { color: var(--ink); font-size: .95rem; margin: 12px 0 0; } .agree.off { opacity: .5; }
.agree input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; white-space: nowrap; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.swatch span { width: 22px; height: 22px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.swatch.on { border-color: var(--accent); font-weight: 700; }

.doc ul, .doc ol { padding-left: 1.3em; } .doc li { margin: .3em 0; } .doc hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0 1em; } .doc a { color: var(--link); } .doc { padding-bottom: 40px; }
