/* むつみデザインのトークン（Zen Maru Gothic・空色・クリーム・黄 CTA・墨）。絵文字・グラデーションを使わない。スマホ優先（上 52px・下タブ等幅・押しどころ 40px・入力 16px） */
:root {
  --sky: #7AC5D7; --cream: #FBF6EC; --cta: #F3C44A; --ink: #3E3A33;
  --sky-pale: #E3F3F7; --sky-deep: #4FA3B8; --line: #E6DFD1; --muted: #8A8378; --sat: #CFE8FF; --sun: #FFD6D9; --err: #B4473C;
  --topbar: 52px; --tabs: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--sky-deep); }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* 上のバー */
.topbar { position: sticky; top: 0; z-index: 10; height: calc(var(--topbar) + env(safe-area-inset-top)); display: flex; align-items: center; padding: 0 8px; padding-top: env(safe-area-inset-top); background: var(--sky); color: #fff; }
.topbar h1 { flex: 1; font-size: 18px; margin: 0; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; min-width: 44px; min-height: 44px; border-radius: 10px; }
.iconbtn:active { background: rgba(255,255,255,.2); }
#back { font-size: 32px; padding-bottom: 4px; }
.topbar .spacer { min-width: 44px; }
.menu { position: absolute; right: 8px; top: calc(var(--topbar) + env(safe-area-inset-top) - 4px); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(62,58,51,.15); min-width: 180px; overflow: hidden; }
.menu-item { display: block; width: 100%; text-align: left; padding: 12px 16px; min-height: 44px; border: 0; background: none; font-size: 16px; text-decoration: none; color: var(--ink); }
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item:disabled { color: var(--muted); }
/* 安否確認の黄色いバー（上のバーの下に固定・全画面） */
.safety-bar { position: sticky; top: calc(var(--topbar) + env(safe-area-inset-top)); z-index: 9; background: var(--cta); color: var(--ink); padding: 8px 12px 10px; border-bottom: 1px solid #E0B23A; }
.sb-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.sb-title { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); text-decoration: none; }
.sb-link { color: var(--ink); font-size: 14px; text-decoration: underline; white-space: nowrap; }
.sb-btns { display: flex; gap: 6px; margin-top: 6px; }
.sb-btn { flex: 1 1 0; width: auto; min-height: 44px; padding: 0 6px; font-size: 14px; line-height: 1.2; background: #fff; border-color: #E0B23A; }
.sb-btn.injured, .choice-btn.injured[aria-pressed="true"] { background: var(--sun); }
.sb-btn.help, .choice-btn.help[aria-pressed="true"] { background: #F4D9A6; }
.sb-done { margin-top: 2px; font-size: 15px; }
.sb-done a { color: var(--ink); }
.sb-sep { margin: 0 6px; color: var(--muted); }
body.on-safety .safety-bar, body.no-tabs .safety-bar { display: none; }
.tag.drill { background: var(--ink); color: #fff; }
/* 掲示板の入口（安否確認が開いているときだけタブの上に 1 行） */
.board-row { position: fixed; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 10; background: var(--cta); border-top: 1px solid #E0B23A; text-align: center; }
.board-row a { display: block; min-height: 40px; line-height: 40px; color: var(--ink); font-weight: 700; text-decoration: none; }
body.has-safety .view { padding-bottom: calc(var(--tabs) + 64px + env(safe-area-inset-bottom)); }
body.no-tabs .board-row { display: none; }

/* 本文と下のタブ */
.view { padding: 16px; padding-bottom: calc(var(--tabs) + 24px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; height: calc(var(--tabs) + env(safe-area-inset-bottom)); display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); font-size: 13px; min-height: 40px; position: relative; }
.tabs a.active { color: var(--sky-deep); font-weight: 700; }
.tabs a.has-dot::after { content: ""; position: absolute; top: 8px; right: calc(50% - 26px); width: 8px; height: 8px; border-radius: 50%; background: var(--cta); }
body.no-tabs .tabs { display: none; }
body.no-tabs .view { padding-bottom: 24px; }

/* 部品 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.card h2 { font-size: 15px; margin: 0 0 8px; color: var(--muted); font-weight: 700; }
.card .big { font-size: 22px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:first-of-type, h2 + .row { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .sub { color: var(--muted); font-size: 13px; }
.row .ellipsis, .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.muted { color: var(--muted); }
.list .row { padding: 10px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cta); flex: 0 0 10px; }
.dot.off { background: transparent; }
.tag { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 10px; background: var(--sky-pale); color: var(--sky-deep); margin-right: 6px; vertical-align: middle; white-space: nowrap; }
.tag.pin { background: var(--cta); color: var(--ink); }
.tag.due { background: var(--sun); color: var(--err); }
.tag.you { background: var(--sat); color: #2F5D8A; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; font-weight: 700; text-decoration: none; color: var(--ink); width: 100%; }
.btn.cta { background: var(--cta); border-color: var(--cta); }
.btn.quiet { background: transparent; }
.btn.small { width: auto; min-height: 40px; padding: 0 14px; font-size: 14px; font-weight: 400; }
.btn:disabled { opacity: .5; }
.btn + .btn { margin-top: 10px; }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }
input[type=text], input[type=search] { width: 100%; font-size: 16px; font-family: inherit; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus { outline: 2px solid var(--sky); outline-offset: 1px; }
.err { color: var(--err); font-size: 14px; margin: 8px 0 0; min-height: 1.2em; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.pre { white-space: pre-wrap; word-break: break-word; }
.linkrow { justify-content: space-between; }
.linkrow::after { content: "›"; color: var(--muted); font-size: 22px; }
.group-head { font-size: 13px; color: var(--muted); font-weight: 700; margin: 16px 4px 6px; }
.group-head:first-child { margin-top: 4px; }

/* 顔写真・頭文字の丸 */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--sky-pale); color: var(--sky-deep); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: 0 0 44px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 96px; height: 96px; flex-basis: 96px; font-size: 36px; margin: 0 auto 12px; }

/* 切替（通知の種類） */
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 4px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 16px; background: var(--line); position: relative; margin: 0; flex: 0 0 52px; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--sky); }
.switch input:checked::after { left: 23px; }
.switch input:disabled { opacity: .6; }

/* 絵文字の代わりの図（ホーム画面に追加の 3 手順） */
.steps { display: flex; justify-content: space-around; gap: 8px; text-align: center; padding: 6px 0; }
.step { flex: 1; }
.step svg { width: 56px; height: 56px; display: block; margin: 0 auto 6px; }
.step span { font-size: 13px; display: block; }
.code { font-size: 32px; letter-spacing: 6px; font-weight: 700; text-align: center; padding: 12px 0; font-variant-numeric: tabular-nums; }

/* やさしい波 */
.wave { height: 12px; margin: 8px 0 16px; background: radial-gradient(circle at 12px -6px, transparent 12px, var(--sky-pale) 13px) 0 0 / 24px 12px repeat-x; }
.logo { width: 96px; height: 96px; border-radius: 22px; margin: 32px auto 16px; display: block; }
.hero { font-size: 24px; font-weight: 700; text-align: center; margin: 0 0 24px; }
.detail dl { margin: 0; }
.detail dt { font-size: 13px; color: var(--muted); margin-top: 10px; }
.detail dd { margin: 0; font-size: 17px; }

/* 安否の回答: 3 択・参集の切替・入力 */
.choice-btn { justify-content: flex-start; padding-left: 48px; position: relative; }
.choice-btn::before { content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -10px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.choice-btn[aria-pressed="true"] { border-color: var(--sky-deep); }
.choice-btn[aria-pressed="true"]::before { border-color: var(--sky-deep); background: var(--sky-deep); box-shadow: inset 0 0 0 3px #fff; }
.choice-btn.ok[aria-pressed="true"] { background: var(--sky-pale); }
.stack-sm > * + * { margin-top: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg-btn { flex: 1 1 0; min-height: 44px; border: 0; background: #fff; font-size: 14px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn[aria-pressed="true"] { background: var(--sky-deep); color: #fff; font-weight: 700; }
.select, .ta { width: 100%; font-size: 16px; font-family: inherit; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); padding: 10px 14px; margin-top: 10px; }
.select { min-height: 48px; }
.ta { resize: vertical; margin-top: 0; }
.stack .ta + .ta { margin-top: 12px; }
.confirm { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.confirm .btn { margin-top: 0; }
/* 集計 */
.nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.num-v { font-size: 28px; font-weight: 700; line-height: 1.1; }
.num-l { font-size: 11px; color: var(--muted); }
.num.injured .num-v { color: var(--err); }
.num.help .num-v { color: #8A5A00; }
.num.unanswered .num-v { color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { border-top: 0; color: var(--muted); font-weight: 400; font-size: 12px; }
.tbl td.warn { color: var(--err); font-weight: 700; }
.tbl td.num-cell { font-variant-numeric: tabular-nums; }
/* 掲示板 */
.post.pinned { border-color: var(--cta); background: #FFFBEE; }
.post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.post-name { font-weight: 700; }
.post-photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-top: 8px; }
.row-btns { display: flex; gap: 8px; align-items: center; }
.row-btns .btn { margin-top: 0; }
.thumb { max-width: 160px; max-height: 160px; border-radius: 10px; display: block; }
/* BCP カード */
.bullets { margin: 0; padding-left: 22px; font-size: 17px; }
.bullets li + li { margin-top: 6px; }
/* 暦の行（勤務と当直・給食）: 土 薄い空色・日祝 薄い桃（kintone 498 と同じ） */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.month-nav .btn { width: 48px; font-size: 22px; padding: 0; }
.month-label { font-size: 18px; font-weight: 700; }
.cal { padding: 6px; }
.cal-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 10px; }
.cal-row + .cal-row { margin-top: 2px; }
.cal-row.sat { background: var(--sat); }
.cal-row.sun { background: var(--sun); }
.cal-row.today { box-shadow: inset 0 0 0 2px var(--sky); }
.cal-row .grow { flex: 1; min-width: 0; }
.cal-row .sub { color: var(--muted); font-size: 12px; }
.cal-date { flex: 0 0 52px; display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.cal-d { font-weight: 700; font-size: 16px; }
.cal-wd { font-size: 13px; color: var(--muted); }
.cal-row.sun .cal-wd { color: var(--err); }
.cal-row.sat .cal-wd { color: #2F5D8A; }
.tag.off { background: var(--cream); color: var(--ink); border: 1px solid var(--line); }
.tag.duty { background: var(--ink); color: #fff; margin-left: 6px; }
.tag.done { background: var(--line); color: var(--muted); }
.cal-total { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 6px 10px; border-top: 1px solid var(--line); margin-top: 6px; font-weight: 700; }
/* 給食の注文: ［注文］・個数の − ＋・［取消］ */
.meal-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: 4px; min-height: 44px; }
.meal-ctl { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 6px; }
.meal-ctl .btn { margin-top: 0; min-height: 44px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.step-btn { width: 38px; min-height: 44px; border: 0; background: #fff; font-size: 20px; }
.step-btn:disabled { color: var(--line); }
.step-v { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-ro { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 声 */
.seg.wrap { flex-wrap: wrap; }
.seg.wrap .seg-btn { flex: 1 1 25%; }
.reply { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--sky-pale); }
/* 入口（申請・学ぶ）の大きなボタン */
.big-btn { min-height: 64px; font-size: 18px; justify-content: space-between; }
.big-btn.cta { justify-content: center; margin-bottom: 16px; }
.big-btn.off { color: var(--muted); background: transparent; }
/* 小さな余白と太字（CSP で style 属性を使わないため・週 5） */
.mt10 { margin-top: 10px; }
.ml8 { margin-left: 8px; }
.bold { font-weight: 700; }
