/* まちの回覧板 — わら半紙 × 黒板緑 × 朱。見出しは鉛筆の Klee One、本文は Zen Kaku Gothic New
   文字サイズは html[data-fs] の rem で全画面に効かせる */
:root {
  --desk: #e8ddc2;
  --paper: #f7f0de;
  --paper-hi: #fbf7ec;
  --under: #e3d6b4;
  --rule: #d3c49c;
  --ink: #33291c;
  --ink2: #5e513c;
  --ink3: #6e6250;
  --green: #2e5e3a;
  --green-d: #234a2d;
  --green-l: #dfe9d3;
  --red: #b5302a;
  --red-d: #8e2620;
  --red-l: #f6ddd3;
  --ochre: #8a6418;
  --hand: "Klee One", "Zen Kaku Gothic New", serif;
  --body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  --tab-h: calc(64px + env(safe-area-inset-bottom));
}
html { font-size: 16px; }
html[data-fs="2"] { font-size: 18.5px; }
html[data-fs="3"] { font-size: 21px; }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--desk); color: var(--ink);
  font-family: var(--body); font-weight: 500; font-size: 1rem; line-height: 1.7;
  line-break: strict; overflow-wrap: break-word; overflow: hidden;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .ob-t, .md-t, .doc-t, .sh-t { font-family: var(--hand); font-weight: 600; font-feature-settings: "palt"; word-break: keep-all; overflow-wrap: normal; }
a { color: var(--green-d); }
.nowrap { white-space: nowrap; }
.ic { width: 24px; height: 24px; flex: none; }
.ic.sm { width: 1.15rem; height: 1.15rem; }
.ic.xs { width: .85rem; height: .85rem; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.app { position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 430px; display: flex; flex-direction: column; background: var(--desk); overflow: hidden; }
@media (min-width: 600px) {
  body { background: radial-gradient(ellipse at 50% 40%, #3b6d47, #22472b 70%); }
  .app { box-shadow: 0 0 0 10px #6b4e2a, 0 0 0 12px #4d3820, 0 30px 80px rgba(0, 0, 0, .45); }
}
.views { position: relative; flex: 1; min-height: 0; background: var(--desk); }
.views::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: repeating-linear-gradient(115deg, rgba(160, 135, 80, .07) 0 2px, transparent 2px 7px), repeating-linear-gradient(25deg, rgba(160, 135, 80, .05) 0 1px, transparent 1px 11px);
}
.boot { padding: 48px 24px; text-align: center; }
.fail { position: absolute; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--desk); }
.fail[hidden] { display: none; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding-bottom: 1.6rem; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.in-r { animation: inR .32s cubic-bezier(.2, .8, .2, 1) both; }
.in-l { animation: inL .32s cubic-bezier(.2, .8, .2, 1) both; }
.in-f { animation: inF .28s ease-out both; }
.out { animation: out .2s ease-in both; pointer-events: none; }
@keyframes inR { from { transform: translateX(36px); opacity: 0; } }
@keyframes inL { from { transform: translateX(-36px); opacity: 0; } }
@keyframes inF { from { opacity: 0; transform: translateY(6px); } }
@keyframes out { to { opacity: 0; } }

/* ---------- ヘッダー（黒板） ---------- */
.hd {
  flex: none; display: flex; align-items: center; gap: 2px;
  padding: calc(env(safe-area-inset-top) + 6px) 4px 8px 14px;
  background: var(--green); color: var(--paper);
  box-shadow: 0 3px 0 var(--green-d);
  position: relative; z-index: 3;
}
.hd:has(.ib:first-child) { padding-left: 4px; }
.hd-t { flex: 1; min-width: 0; }
.hd-sub { font-size: .75rem; color: #dce7cf; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-h { font-size: 1.4rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; color: inherit; text-decoration: none;
  transition: transform .12s, background-color .2s;
}
.ib:active { transform: scale(.9); background: rgba(255, 255, 255, .12); }
.ib:disabled { opacity: .3; cursor: default; }
.fs { display: flex; flex: none; border-radius: 12px; background: rgba(0, 0, 0, .18); padding: 2px; }
.fs-b {
  width: 34px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #f7f0de;
  font-family: var(--hand); font-weight: 600; line-height: 1; display: grid; place-items: center;
  transition: background-color .2s, transform .12s;
}
.fs-b.s1 { font-size: 13px; }
.fs-b.s2 { font-size: 17px; }
.fs-b.s3 { font-size: 21px; }
.fs-b.on { background: var(--paper); color: var(--green-d); }
.fs-b:active { transform: scale(.9); }

/* ---------- タブ（付箋のインデックス） ---------- */
.tabs {
  flex: none; height: var(--tab-h); padding: 0 6px env(safe-area-inset-bottom);
  display: flex; align-items: stretch; gap: 4px; background: #d9cba6;
  box-shadow: inset 0 2px 0 #c7b688; position: relative; z-index: 5;
}
.tab {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  margin-top: 6px; border-radius: 0 0 12px 12px; color: var(--ink2); text-decoration: none;
  transition: background-color .2s, transform .15s;
}
.tab.on { background: var(--paper); color: var(--green-d); margin-top: 0; box-shadow: inset 0 3px 0 var(--green), 0 2px 6px rgba(51, 41, 28, .15); }
.tab:active { transform: translateY(1px); }
.tab-ic { position: relative; display: grid; place-items: center; }
.tab-l { font-family: var(--hand); font-weight: 600; font-size: 12px; line-height: 1.3; white-space: nowrap; }
.badge { position: absolute; top: -5px; right: -13px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px #d9cba6; }
.badge[hidden] { display: none; }
.tab.on .badge { box-shadow: 0 0 0 2px var(--paper); }

/* ---------- 共通部品 ---------- */
.paper { background: var(--paper); border-radius: 3px; box-shadow: 0 1px 0 var(--under), 0 8px 20px rgba(51, 41, 28, .1); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .3rem 1.3rem; border: 0; border-radius: 12px;
  background: var(--green); color: var(--paper); font-size: 1rem; font-weight: 700; line-height: 1.35; text-decoration: none; word-break: keep-all;
  box-shadow: 0 3px 0 #1e3f27; transition: transform .1s, box-shadow .1s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #1e3f27; }
.btn.big { width: 100%; min-height: 3.4rem; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--green-d); box-shadow: inset 0 0 0 2px var(--green); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--green); }
.btn.red { background: var(--red); box-shadow: 0 3px 0 #7e1f1a; }
.btn:disabled { background: #d3c7a8; color: #4e4433; box-shadow: none; cursor: default; }
.link { border: 0; background: transparent; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 .6rem; font-size: .9rem; }
.cat { flex: none; padding: .05rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.c-event { background: var(--green-l); color: var(--green-d); }
.c-garbage { background: #e2e8f0; color: #2c4767; }
.c-safety { background: var(--red-l); color: var(--red-d); }
.c-money { background: #f2e3bd; color: #66460c; }
.c-info { background: #e9e2d1; color: #4e4433; }
.imp { display: inline-flex; align-items: center; gap: 2px; font-size: .75rem; font-weight: 700; color: var(--red-d); white-space: nowrap; }
.sec-h { display: flex; align-items: center; gap: .4rem; padding: 1.1rem 1.1rem .4rem; font-size: 1.1rem; color: var(--green-d); }
.empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.4rem 1.2rem; text-align: center; }
.empty-img { width: 10rem; height: 10rem; object-fit: cover; border-radius: 50%; border: 5px solid #fff; transform: rotate(-3deg); }
.empty-t { font-family: var(--hand); font-weight: 600; font-size: 1.15rem; }
.empty-s { font-size: .92rem; color: var(--ink2); }

/* 判子 */
.hanko {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  border: 2.5px solid var(--red); color: var(--red);
  font-family: var(--hand); font-weight: 600; transform: rotate(-8deg);
  box-shadow: inset 0 0 0 1.5px rgba(181, 48, 42, .18);
}
.hk-t { writing-mode: vertical-rl; font-size: .92rem; line-height: 1; letter-spacing: 0; }
.hanko.one .hk-t { writing-mode: horizontal-tb; font-size: 1.3rem; }
.hanko.pressing { animation: press .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.hanko.pressing::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid rgba(181, 48, 42, .35); animation: ink .7s .25s ease-out both; }
@keyframes press { 0% { transform: scale(2.6) rotate(-24deg); opacity: 0; } 55% { transform: scale(.88) rotate(-5deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }
@keyframes ink { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.hanko.mini { width: 2rem; height: 2rem; border-color: var(--paper); color: var(--paper); border-width: 2px; box-shadow: none; }
.hanko.mini .hk-t { font-size: .7rem; }
.hand-c { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; }

/* ---------- お知らせ ---------- */
.filters { display: flex; gap: .5rem; padding: .8rem .75rem .2rem; overflow-x: auto; scrollbar-width: none; }
.flt {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1rem;
  border: 2px solid var(--rule); border-radius: 999px; background: var(--paper-hi); font-size: .95rem; font-weight: 700; color: var(--ink);
  transition: background-color .2s, transform .12s;
}
.flt:active { transform: scale(.95); }
.flt-n { font-family: var(--hand); font-weight: 600; color: var(--ink2); }
.flt.on { background: var(--green); border-color: var(--green); color: var(--paper); }
.flt.on .flt-n { color: #dce7cf; }
.board { position: relative; margin: 1.3rem .7rem .5rem; padding: 2.1rem .5rem .55rem; border-radius: 16px; background: var(--green); box-shadow: inset 0 0 0 3px #3d7349, 0 6px 16px rgba(51, 41, 28, .25); }
.clip {
  position: absolute; top: -14px; left: 50%; width: 132px; height: 42px; margin-left: -66px; z-index: 2;
  border-radius: 12px 12px 8px 8px; background: linear-gradient(#f2f2ee, #b5b6af 55%, #d9dad4); box-shadow: 0 3px 6px rgba(0, 0, 0, .35), inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.clip::before { content: ""; position: absolute; top: -12px; left: 50%; width: 30px; height: 24px; margin-left: -15px; border-radius: 14px 14px 4px 4px; border: 5px solid #c9cac3; border-bottom: 0; }
.stack { box-shadow: 0 1px 0 var(--under), 3px 3px 0 #ece1c4, 6px 6px 0 #dfd1ac; padding-bottom: .3rem; }
.pp-head { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem .5rem; border-bottom: 2px solid var(--rule); }
.pp-k { font-family: var(--hand); font-weight: 600; font-size: .95rem; color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 0 .45rem; transform: rotate(-4deg); line-height: 1.5; }
.pp-m { font-family: var(--hand); font-weight: 600; font-size: 1rem; }
.nl { list-style: none; margin: 0; padding: 0; }
.ni { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem .9rem; color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--rule); transition: background-color .15s; }
.nl li:last-child .ni { border-bottom: 0; }
.ni:active { background: #efe5cc; }
.ni-top { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.ni-d { font-family: var(--hand); font-weight: 600; font-size: .85rem; color: var(--ink2); margin-left: auto; white-space: nowrap; }
.unread-tag { font-family: var(--hand); font-weight: 600; font-size: .78rem; color: #fff; background: var(--red); padding: 0 .45rem; border-radius: 3px; transform: rotate(3deg); line-height: 1.6; }
.ni-t { font-size: 1.07rem; font-weight: 700; line-height: 1.55; }
.ni.read .ni-t { font-weight: 500; }
.ni-by { font-size: .85rem; color: var(--ink2); }
.ni-r { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; margin-top: .2rem; }
.dots { display: flex; gap: 3px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #c2b081; }
.dots i.on { background: var(--red); border-color: var(--red); }
.dots i.me { box-shadow: 0 0 0 1.5px var(--paper), 0 0 0 3px var(--green); }
.ni-rate { font-size: .82rem; color: var(--ink2); }
.ni-rate b { color: var(--red-d); margin-left: .25rem; }

/* 回覧の紙 */
.doc { margin: .9rem .7rem .4rem; padding: 1.2rem 1.1rem 1.4rem; position: relative; }
.doc-top { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.kairan { font-family: var(--hand); font-weight: 600; font-size: .9rem; color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 0 .45rem; transform: rotate(-4deg); line-height: 1.5; }
.doc-t { font-size: 1.45rem; line-height: 1.5; margin: .6rem 0 .25rem; }
.doc-m { font-size: .88rem; color: var(--ink2); }
.doc-b p { font-size: 1rem; line-height: 1.95; margin-top: .8rem; }
.doc-fig { margin: 1.1rem 0 0; }
.doc-fig img { display: block; width: 100%; height: auto; border: 6px solid #fff; box-shadow: 0 4px 12px rgba(51, 41, 28, .18); transform: rotate(-1deg); }
.doc-fig figcaption { font-size: .88rem; color: var(--ink2); margin-top: .5rem; }
.inkan { margin-top: 1.4rem; padding-top: 1rem; border-top: 2px dashed var(--rule); }
.ink-h { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; font-size: 1.15rem; }
.ink-n { font-family: var(--body); font-size: .9rem; font-weight: 700; color: var(--red-d); }
.ink-bar { height: 8px; border-radius: 4px; background: #eadfc2; margin: .5rem 0 .8rem; overflow: hidden; }
.ink-bar i { display: block; height: 100%; border-radius: 4px; background: var(--red); transition: width .6s ease; }
.ink-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1.5px solid #bfae84; border-left: 1.5px solid #bfae84; }
.ink-c { display: flex; flex-direction: column; align-items: center; padding: .25rem .15rem .45rem; border-right: 1.5px solid #bfae84; border-bottom: 1.5px solid #bfae84; min-width: 0; }
.ink-c.me { background: #e7eedb; }
.ink-no { align-self: flex-start; font-family: var(--hand); font-weight: 600; font-size: .7rem; color: var(--ink2); line-height: 1.2; }
.ink-name { font-size: .78rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.ink-c.me .ink-name { color: var(--green-d); }
.ink-slot { height: 3.1rem; display: grid; place-items: center; }
.ink-empty { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1.5px dashed #c2b081; }
.ink-note { font-size: .82rem; color: var(--ink2); margin-top: .6rem; line-height: 1.7; }
.stamp-btn { margin-top: 1.3rem; }
.done-row { display: flex; flex-direction: column; align-items: center; gap: .2rem; margin-top: 1.2rem; text-align: center; }
.done-t { display: flex; align-items: flex-start; gap: .4rem; font-size: .95rem; color: var(--green-d); }
.done-t .ic { margin-top: .3rem; }

/* ---------- 行事 ---------- */
.cal { margin: .9rem .7rem .2rem; padding: .6rem .5rem .9rem; }
.cal-h { display: flex; align-items: center; justify-content: space-between; color: var(--ink); }
.cal-t { display: flex; align-items: baseline; gap: .35rem; }
.cal-y { font-size: .9rem; color: var(--ink2); }
.cal-m { font-size: 1.7rem; }
.cal-w { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-family: var(--hand); font-weight: 600; font-size: .82rem; color: var(--ink2); padding: .2rem 0 .3rem; border-bottom: 1.5px solid var(--rule); }
.cal-w .sun, .cd.sun .cd-n { color: var(--red); }
.cal-w .sat, .cd.sat .cd-n { color: #2c4767; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: .3rem; }
.cd { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 3.2rem; min-width: 0; padding-top: .3rem; color: var(--ink); text-decoration: none; border-radius: 8px; overflow: hidden; }
.cd.today { background: var(--green-l); }
.cd.past .cd-n { color: var(--ink3); }
.cd-n { position: relative; font-family: var(--hand); font-weight: 600; font-size: 1.05rem; line-height: 1.5; }
.cd .hand-c { position: absolute; top: 0; left: 50%; width: 2.5rem; height: 2.5rem; margin-left: -1.25rem; stroke-dasharray: 130; animation: draw .9s ease-out both; }
@keyframes draw { from { stroke-dashoffset: 130; } to { stroke-dashoffset: 0; } }
.cd-e { max-width: 100%; font-size: 11px; font-weight: 700; color: var(--red-d); white-space: nowrap; overflow: hidden; line-height: 1.4; margin-top: .1rem; }
.cd.has:active { background: var(--red-l); }
.evl { list-style: none; margin: 0; padding: 0 .7rem; }
.ev {
  position: relative; display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .7rem; align-items: center;
  margin-top: .7rem; padding: .75rem .75rem .75rem .5rem; background: var(--paper); border-radius: 3px;
  box-shadow: 0 1px 0 var(--under), 0 6px 14px rgba(51, 41, 28, .1); color: var(--ink); text-decoration: none;
  transition: transform .12s;
}
.ev::before { content: ""; position: absolute; top: -7px; left: 50%; width: 58px; height: 16px; margin-left: -29px; background: rgba(214, 196, 150, .75); transform: rotate(-3deg); }
.ev:active { transform: scale(.98); }
.ev-d { display: flex; flex-direction: column; align-items: center; border-right: 2px dashed var(--rule); padding-right: .4rem; line-height: 1.15; }
.ev-m { font-family: var(--hand); font-weight: 600; font-size: .8rem; color: var(--ink2); }
.ev-n { font-family: var(--hand); font-weight: 600; font-size: 1.8rem; }
.ev-w { font-size: .8rem; color: var(--ink2); }
.ev-b { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; min-width: 0; }
.ev-t { font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.ev-s { font-size: .85rem; color: var(--ink2); line-height: 1.6; }
.ans { font-size: .75rem; font-weight: 700; padding: 0 .5rem; border-radius: 4px; line-height: 1.7; white-space: nowrap; }
.a-yes { background: var(--green-l); color: var(--green-d); }
.a-no { background: #e9e2d1; color: #4e4433; }
.a-maybe { background: #f2e3bd; color: #66460c; }
.a-none { background: var(--red-l); color: var(--red-d); }
.ev-img { width: 4.4rem; height: 4.4rem; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(51, 41, 28, .2); transform: rotate(2deg); }
.ev-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.ev-doc { margin-top: -1.6rem; }
.ev-info { margin: .6rem 0 0; }
.ev-info > div { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px dashed var(--rule); }
.ev-info dt { flex: none; width: 4em; font-family: var(--hand); font-weight: 600; font-size: .92rem; color: var(--green-d); }
.ev-info dd { margin: 0; font-size: .98rem; }
.rel { display: inline-flex; align-items: center; gap: .3rem; min-height: 44px; margin-top: .4rem; font-size: .95rem; font-weight: 700; }
.rsvp { margin-top: 1.1rem; }
.rs-h { display: flex; align-items: baseline; flex-wrap: wrap; font-size: 1.15rem; margin-bottom: .6rem; }
.rs-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.rs-b { min-height: 3.2rem; padding: .3rem .25rem; border: 2px solid var(--rule); border-radius: 10px; background: var(--paper-hi); color: var(--ink); font-size: .92rem; font-weight: 700; line-height: 1.3; word-break: keep-all; transition: background-color .15s, transform .12s; }
.rs-b:active { transform: scale(.96); }
.rs-b.on.r-yes { background: var(--green); border-color: var(--green); color: var(--paper); }
.rs-b.on.r-no { background: var(--ink2); border-color: var(--ink2); color: var(--paper); }
.rs-b.on.r-maybe { background: var(--ochre); border-color: var(--ochre); color: #fff; }
.rs-cnt { margin-top: .7rem; }
.rs-cnt[hidden] { display: none; }
.rs-row { display: flex; align-items: center; justify-content: space-between; padding: .25rem 0; }
.rs-l { font-size: 1rem; font-weight: 700; }
.step { display: flex; align-items: center; gap: .3rem; }
.step-b { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--rule); background: var(--paper-hi); color: var(--ink); display: grid; place-items: center; transition: transform .12s; }
.step-b:active:not(:disabled) { transform: scale(.9); }
.step-b:disabled { color: #8a7f6a; cursor: default; }
.step-v { min-width: 3.4rem; text-align: center; font-family: var(--hand); font-weight: 600; font-size: 1.2rem; }
.rsvp .btn.big { margin-top: .9rem; }
.rs-note { font-size: .85rem; color: var(--ink2); margin-top: .6rem; }
.tally { margin-top: 1.4rem; padding-top: 1rem; border-top: 2px dashed var(--rule); }
.tl-n { font-family: var(--body); font-size: .85rem; font-weight: 500; color: var(--ink2); margin-left: .6rem; }
.tl-bar { display: flex; height: 1rem; border-radius: 4px; overflow: hidden; margin: .2rem 0 .6rem; }
.tl-bar i { display: block; }
.tl-bar .y, .tl-leg .y { background: var(--green); }
.tl-bar .m, .tl-leg .m { background: #c99a3a; }
.tl-bar .n, .tl-leg .n { background: #9c8f75; }
.tl-leg { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; }
.tl-leg i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .3rem; }
.tl-leg b { margin-left: .3rem; }
.tl-ppl { font-family: var(--hand); font-weight: 600; font-size: .98rem; margin-top: .5rem; }
.tl-ppl b { font-size: 1.3rem; color: var(--red-d); margin: 0 .1rem; }

/* ---------- 当番表 ---------- */
.my-duty { position: relative; margin: 1.2rem .9rem .4rem; padding: 1rem 1.1rem 1.1rem; background: #f4e7b6; transform: rotate(-.6deg); }
.my-duty::before { content: ""; position: absolute; top: -9px; left: 1.4rem; width: 64px; height: 18px; background: rgba(205, 186, 140, .8); transform: rotate(-5deg); }
.md-l { font-family: var(--hand); font-weight: 600; font-size: .88rem; color: var(--red-d); }
.md-t { font-size: 1.4rem; line-height: 1.45; }
.md-w { font-size: .98rem; font-weight: 700; }
.md-s { font-size: .92rem; color: var(--ink2); line-height: 1.8; margin-top: .3rem; }
.md-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .7rem; }
.chk { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .95rem; font-weight: 700; cursor: pointer; }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk-b { width: 1.7rem; height: 1.7rem; border: 2px solid var(--ink2); border-radius: 5px; display: grid; place-items: center; background: var(--paper-hi); color: var(--paper); transition: background-color .15s; }
.chk-b .ic { opacity: 0; }
.chk input:checked + .chk-b { background: var(--green); border-color: var(--green); }
.chk input:checked + .chk-b .ic { opacity: 1; }
.chk input:focus-visible + .chk-b { outline: 3px solid var(--red); outline-offset: 2px; }
.md-act .btn { min-height: 44px; padding: 0 .9rem; font-size: .92rem; }
.pend { display: flex; gap: .5rem; margin: .7rem .7rem 0; padding: .7rem .9rem; border-radius: 8px; border: 2px dashed #c99a3a; background: var(--paper); font-size: .9rem; line-height: 1.7; }
.pend .ic { margin-top: .25rem; color: var(--ochre); }
.tbl-wrap { margin: .9rem .7rem .3rem; padding: .5rem .45rem .8rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; table-layout: fixed; }
.tbl th, .tbl td { border: 1px solid #cdbd93; padding: .4rem .25rem; text-align: center; vertical-align: middle; }
.tbl thead th { background: var(--green); color: var(--paper); font-family: var(--hand); font-weight: 600; font-size: .85rem; line-height: 1.35; }
.tbl thead th .ic { display: block; margin: 0 auto 2px; }
.tbl thead th:first-child { width: 34%; }
.tbl tbody th { font-family: var(--hand); font-weight: 600; font-size: .9rem; text-align: left; padding-left: .45rem; }
.tw { display: block; }
.now-tag { display: inline-block; font-family: var(--body); font-size: .7rem; font-weight: 700; color: var(--green-d); background: var(--green-l); padding: 0 .35rem; border-radius: 4px; line-height: 1.6; }
.tbl tr.cur { background: #eef3e4; }
.tbl tr.past th, .tbl tr.past td { background: #eee5cd; color: var(--ink3); }
.hn { font-size: 1rem; }
.mine-b { position: relative; min-height: 44px; min-width: 4.4rem; padding: 0 .3rem; border: 0; background: transparent; color: var(--red-d); font-family: var(--hand); font-weight: 600; font-size: 1rem; }
.mine-b .hand-c { position: absolute; inset: 2px -2px; width: calc(100% + 4px); height: calc(100% - 4px); }
.mine-b span { position: relative; }
.done-m { display: inline-flex; align-items: center; gap: 1px; margin-left: .2rem; padding: 0 .3rem; border-radius: 4px; background: var(--green-l); color: var(--green-d); font-size: .72rem; font-weight: 700; vertical-align: middle; line-height: 1.6; }
.tbl-note { font-size: .85rem; color: var(--ink2); padding: .6rem .3rem 0; line-height: 1.7; }

/* ---------- アンケート ---------- */
.svl { list-style: none; margin: 0 .7rem; padding: 0 1rem; }
.svl li + li { border-top: 1px dashed var(--rule); }
.sv { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 0; color: var(--ink); text-decoration: none; }
.sv:active { opacity: .8; }
.sv-top { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.due { font-family: var(--hand); font-weight: 600; font-size: .85rem; color: var(--red-d); }
.due.closed { color: var(--ink2); }
.sv-t { font-size: 1.07rem; font-weight: 700; line-height: 1.5; }
.sv-r { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .5rem; font-size: .85rem; color: var(--ink2); }
.mini-bar { width: 5rem; height: 6px; border-radius: 3px; background: #eadfc2; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--green); }
.q-q { font-size: 1rem; line-height: 1.9; margin: .5rem 0 1rem; }
.opts { display: flex; flex-direction: column; gap: .55rem; }
.opt {
  display: flex; align-items: center; gap: .75rem; min-height: 3.2rem; padding: .5rem .9rem;
  border: 2px solid var(--rule); border-radius: 10px; background: var(--paper-hi); color: var(--ink);
  font-size: 1rem; font-weight: 700; text-align: left; transition: background-color .15s, transform .12s;
}
.opt:active { transform: scale(.98); }
.opt-box { width: 1.6rem; height: 1.6rem; flex: none; display: grid; place-items: center; border: 2px solid var(--ink2); border-radius: 50%; color: var(--paper); background: var(--paper-hi); }
.opt.multi .opt-box { border-radius: 5px; }
.opt-box .ic { opacity: 0; }
.opt.on { border-color: var(--green); background: var(--green-l); }
.opt.on .opt-box { background: var(--green); border-color: var(--green); }
.opt.on .opt-box .ic { opacity: 1; }
.sh-err { color: var(--red-d); font-size: .9rem; font-weight: 700; margin-top: .5rem; }
.sh-err[hidden] { display: none; }
.doc .btn.big { margin-top: 1.1rem; }
.res-h { font-size: .95rem; color: var(--ink2); margin-bottom: .9rem; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.bar-l { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: 1rem; font-weight: 700; }
.you { display: inline-flex; align-items: center; gap: 2px; padding: 0 .4rem; border-radius: 4px; background: var(--red); color: #fff; font-size: .72rem; line-height: 1.7; }
.bar-row { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.bar { flex: 1; height: 1.3rem; border-radius: 3px; background: #ede3c9; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px 9px 6px 3px; background: repeating-linear-gradient(-60deg, #2e5e3a 0 6px, #3f7550 6px 9px); animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.bars li.mine .bar i { background: repeating-linear-gradient(-60deg, #b5302a 0 6px, #c9493f 6px 9px); }
@keyframes grow { from { transform: scaleX(0); } }
.bar-v { flex: none; min-width: 5.6rem; text-align: right; font-family: var(--hand); font-weight: 600; font-size: .98rem; }
.bar-p { color: var(--ink2); margin-left: .3rem; font-size: .85rem; }
.res .link { margin-top: .8rem; }

/* ---------- 設定・このアプリについて ---------- */
.set { margin: .9rem .7rem 0; padding: 1rem 1.1rem; }
.me-row { display: flex; align-items: center; gap: .9rem; }
.me-row .hanko { width: 3.2rem; height: 3.2rem; }
.me-n { font-family: var(--hand); font-weight: 600; font-size: 1.2rem; }
.me-s { font-size: .88rem; color: var(--ink2); }
.set-h { font-size: 1.05rem; color: var(--green-d); margin-bottom: .6rem; }
.fs-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.fsb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 4.6rem; border: 2px solid var(--rule); border-radius: 10px; background: var(--paper-hi); color: var(--ink); font-size: .9rem; font-weight: 700; }
.fsb.on { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.fsb-a { font-family: var(--hand); font-weight: 600; line-height: 1.1; }
.fsb-a.s1 { font-size: 18px; }
.fsb-a.s2 { font-size: 24px; }
.fsb-a.s3 { font-size: 30px; }
.set-s { font-size: .88rem; color: var(--ink2); line-height: 1.7; margin-top: .3rem; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0 .8rem; border-bottom: 1px dashed var(--rule); }
.sw-b { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: left; }
.set-t { font-size: 1rem; font-weight: 700; }
.set-t.red { color: var(--red-d); }
.sw { -webkit-appearance: none; appearance: none; flex: none; position: relative; margin: 0; width: 52px; height: 30px; border-radius: 15px; background: #cfc3a3; cursor: pointer; transition: background-color .2s; }
.sw::before { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper-hi); box-shadow: 0 1px 3px rgba(51, 41, 28, .3); transition: transform .2s; }
.sw:checked { background: var(--green); }
.sw:checked::before { transform: translateX(22px); }
.row { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 3.6rem; padding: .7rem 0; border: 0; border-bottom: 1px dashed var(--rule); background: transparent; color: var(--ink); text-decoration: none; text-align: left; }
.set .row:last-child { border-bottom: 0; }
.about { text-align: center; display: flex; flex-direction: column; align-items: center; }
.about-ic { width: 6rem; height: 6rem; border-radius: 1.4rem; transform: rotate(-2deg); box-shadow: 0 6px 16px rgba(51, 41, 28, .2); }
.about-n { font-family: var(--hand); font-weight: 600; font-size: 1.5rem; margin-top: .7rem; }
.about-v { font-size: .88rem; color: var(--ink2); }
.about-p { text-align: left; font-size: .98rem; line-height: 1.9; margin-top: 1rem; align-self: stretch; }
.about .set-h { align-self: stretch; text-align: left; margin-top: 1.2rem; }
.tech { list-style: none; margin: 0 0 1rem; padding: 0; align-self: stretch; text-align: left; }
.tech li { position: relative; padding: .5rem 0 .5rem 1.2rem; border-bottom: 1px dashed var(--rule); font-size: .95rem; }
.tech li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: .55rem; height: .55rem; border-radius: 50%; border: 2px solid var(--red); }

/* ---------- シート・トースト ---------- */
.sheet { position: absolute; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.veil { position: absolute; inset: 0; background: rgba(51, 41, 28, .38); opacity: 0; transition: opacity .25s; }
.sheet.open .veil { opacity: 1; }
.sh { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; overflow-y: auto; padding: 1.3rem 1.1rem calc(env(safe-area-inset-bottom) + 1.2rem); border-radius: 16px 16px 0 0; background: var(--paper-hi); transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.sheet.open .sh { transform: none; }
.sh-t { font-size: 1.3rem; }
.sh-p { font-size: .95rem; color: var(--ink2); margin: .5rem 0 1rem; line-height: 1.8; }
.pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.pk { min-height: 44px; padding: 0 1rem; border: 2px solid var(--rule); border-radius: 999px; background: var(--paper); font-size: .95rem; font-weight: 700; color: var(--ink); }
.pk.on { background: var(--green); border-color: var(--green); color: var(--paper); }
.sh-acts { display: flex; gap: .6rem; margin-top: 1.2rem; }
.sh-acts .btn { flex: 1; padding: .3rem .6rem; }
.toast { position: absolute; left: 50%; bottom: calc(var(--tab-h) + 12px); z-index: 60; display: flex; align-items: center; gap: .4rem; width: max-content; max-width: calc(100% - 24px); min-height: 48px; padding: .35rem .4rem .35rem 1rem; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: .92rem; line-height: 1.5; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: transform .25s, opacity .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-a { flex: none; border: 0; background: transparent; color: #f4c7bd; font-weight: 700; min-height: 44px; padding: 0 .7rem; border-radius: 8px; }

/* ---------- スプラッシュ・オンボーディング ---------- */
.splash { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; background: var(--green); transition: opacity .35s; }
.splash[hidden] { display: none; }
.splash img { width: 7rem; height: 7rem; border-radius: 1.6rem; margin-bottom: .6rem; animation: drop .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.splash-n { font-family: var(--hand); font-weight: 600; font-size: 1.6rem; color: var(--paper); }
.splash-s { font-size: .9rem; color: #dce7cf; }
.splash.bye { opacity: 0; }
@keyframes drop { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } }
.onboard { position: absolute; inset: 0; z-index: 70; background: var(--desk); transition: opacity .35s; }
.onboard[hidden] { display: none; }
.onboard.bye { opacity: 0; }
.ob-img { position: absolute; left: 0; right: 0; top: 0; height: 64%; background-size: cover; background-position: center 70%; }
.ob-card { position: absolute; left: .8rem; right: .8rem; bottom: calc(env(safe-area-inset-bottom) + .8rem); padding: 1.3rem 1.2rem 1.2rem; }
.ob-step { display: flex; gap: 6px; }
.ob-step i { width: 8px; height: 8px; border-radius: 4px; background: var(--rule); transition: width .3s; }
.ob-step i.on { width: 24px; background: var(--red); }
.ob-t { font-size: 1.5rem; line-height: 1.45; margin-top: .6rem; }
.ob-s { font-size: .98rem; color: var(--ink2); line-height: 1.85; margin-top: .4rem; }
.ob-acts { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
.ni-t, .ev-t, .sv-t { word-break: keep-all; }
.res .btn.big { margin-top: 1.2rem; }
