/* 통조림 동기모임 앱. 폰 한 손 조작 기준 세로 흐름 + 아래 고정 탭.
   색: 아이콘 캐릭터의 주황 + 역사 벽 크림색. 근무 칩은 회사 근무표 앱과 같은 모양(주간 노랑 동그라미, 야간 검정, 비번·휴무 빨간 글자) */
:root {
  color-scheme: light;
  --bg: #fbf6ec;
  --card: #ffffff;
  --cell: #f6efe1;
  --ink: #2a2118;
  --muted: #7b6e60;
  --line: #eadfcb;
  --brand: #f2a93b;
  --brand-dk: #b8670f;
  --brand-soft: #fdf0d9;
  --green: #2f9e44;
  --line2: #3baa4a; /* 2호선 초록 */
  --red: #e03131;
  --red-soft: #fdecec;
  --blue: #1c64d6;
  --blue-soft: #e7f0fd;
  --ju: #ffd43b;
  --ya: #343a40;
  --radius: 16px;
  --tabbar: 64px;
  --display: "Black Han Sans", "Noto Sans KR", system-ui, sans-serif;
  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 15px; line-height: 1.5; -webkit-tap-highlight-color: transparent; overflow-wrap: anywhere; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { margin: 0; line-height: 1.25; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 18px; }
.red { color: var(--red); }
.blue { color: var(--blue); }
.ok { color: var(--green); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.grow { flex: 1; min-width: 0; }
hr { border: 0; border-top: 1px dashed var(--line); width: 100%; margin: 6px 0; }
mark { background: #ffe58f; padding: 0 1px; border-radius: 3px; }

/* ---------- 버튼·입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--brand); color: var(--ink); font-weight: 800; text-align: center;
  box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.ghost { background: var(--card); box-shadow: 0 2px 0 var(--line); border-color: var(--line); font-weight: 700; }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; }
.btn.busy::after { content: '…'; }
.pill { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.nav-btn { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 22px; font-weight: 800; line-height: 1; }
.nav-btn:disabled { opacity: .3; }
input:not([type=radio]), textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-size: 16px; /* 16px 미만이면 아이폰이 화면을 확대한다 */
}
input:focus, textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.search { margin-bottom: 10px; }
.label { font-weight: 700; font-size: 14px; display: block; margin-top: 4px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dk); margin-left: 4px; vertical-align: 2px; white-space: nowrap; }
.badge.me { background: var(--blue-soft); color: var(--blue); }
.badge.warn { background: var(--red-soft); color: var(--red); }

/* 여러 개 중 하나 고르기 (직렬, 근무 형태, 탭 전환) */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.seg.five { grid-template-columns: repeat(5, 1fr); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span, .seg > button {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 4px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; text-align: center; font-size: 14px;
}
.seg-opt input:checked + span, .seg > button[aria-selected=true], .seg > button[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--brand); }
.seg.wide { margin-bottom: 10px; }

/* ---------- 카드·틀 ---------- */
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card-title { font-size: 17px; font-weight: 900; margin-bottom: 8px; }
.warn-card { border-color: #f5c46b; background: #fff8ea; }
.panels { padding: 12px 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; padding-top: calc(12px + env(safe-area-inset-top)); }
.tab-head { margin: 4px 2px 12px; }
.tab-head h1 { font-family: var(--display); font-weight: 400; font-size: 26px; }
.shout { margin: 2px 0 0; font-family: var(--display); color: var(--red); font-size: 18px; }
.loading { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); }
.loading img { border-radius: 22px; margin: 0 auto; }

/* ---------- 아래 탭 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fffdf8; border-top: 1.5px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { min-height: var(--tabbar); border: 0; background: none; display: grid; place-items: center; gap: 0; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.tabbar .ti { font-size: 22px; line-height: 1.1; filter: grayscale(1); opacity: .6; }
.tabbar button[aria-selected=true] { color: var(--ink); }
.tabbar button[aria-selected=true] .ti { filter: none; opacity: 1; }

/* ---------- 로그인 전 ---------- */
#gate { padding: calc(20px + env(safe-area-inset-top)) 16px 40px; max-width: 520px; margin: 0 auto; }
.gate-head { text-align: center; margin: 12px 0 18px; }
.gate-head img { border-radius: 22px; box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
.gate-head h1 { font-family: var(--display); font-weight: 400; font-size: 36px; margin-top: 6px; }
.gate-head p { margin: 0; color: var(--muted); }
#gate > .btn { width: 100%; }

/* ---------- 설치 안내 ---------- */
.install-bar { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; margin-bottom: 12px; border-radius: 14px; border: 1.5px dashed var(--brand); background: var(--brand-soft); font-size: 14px; }
.install-bar img { border-radius: 9px; flex: none; }
.install-bar span { flex: 1; }
.install-bar b { color: var(--brand-dk); white-space: nowrap; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }

/* ---------- 홈 ---------- */
.hero { background: linear-gradient(160deg, #fff3dc, #fff); border: 2px solid var(--ink); border-radius: 20px; padding: 14px; margin-bottom: 12px; box-shadow: 0 4px 0 var(--ink); display: grid; gap: 10px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: 26px; }
.hero-icon { border-radius: 12px; }
.hero-today { margin: 0; }
.teams-today { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tt { border-radius: 14px; padding: 8px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.tt b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.d-ju-bg { background: #fff3bf; }
.d-ya-bg { background: var(--ya); color: #fff; }
.dot-on { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--line2); vertical-align: 0; }
.duty-block { margin-top: 10px; }
.duty-head { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px 3px 3px; max-width: 100%; text-align: left; position: relative; }
.person .pn { font-weight: 700; font-size: 14px; }
.person .pw { font-size: 12px; color: var(--muted); }
.person.on { border-color: var(--line2); }
.person.on::after { content: ''; position: absolute; top: 0; left: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--line2); border: 2px solid #fff; }
.person.static { cursor: default; }
.list-btn { width: 100%; border: 0; background: var(--cell); border-radius: 12px; padding: 8px 10px; }
.ava { --c: #888; --s: 36px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; background: var(--c); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .45); }

/* ---------- 근무 칩 ---------- */
.duty { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; border: 1.5px solid transparent; vertical-align: 1px; }
.d-ju { background: var(--ju); color: #2a2118; }
.d-ya { background: var(--ya); color: #fff; }
.d-bi { color: var(--red); border-color: #f3b8b8; background: #fff; }
.d-hu { color: var(--red); background: var(--red-soft); }
.d-ts { background: var(--blue-soft); color: var(--blue); }
.d-yg { background: #e3f6e8; color: var(--green); }
.d-ed { background: #efe6fb; color: #7048b6; }

/* ---------- 모임 카드 ---------- */
.meet { border: 2px solid var(--ink); border-radius: 16px; padding: 12px; display: grid; gap: 6px; background: #fffdf8; }
.dd { font-family: var(--display); font-size: 20px; color: var(--brand-dk); }
.dd.now { color: var(--red); }
.meet-title { font-size: 19px; font-weight: 900; }
.names { font-size: 14px; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yn button { min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 16px; }
.yn .y[aria-pressed=true] { background: var(--line2); border-color: var(--line2); color: #fff; }
.yn .n[aria-pressed=true] { background: var(--red); border-color: var(--red); color: #fff; }

.past-meet { border-width: 1.5px; border-color: var(--line); background: #fff; }
.q-card { border: 2px dashed var(--brand); background: #fffaf0; }
.rank-list { display: grid; gap: 4px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--cell); }
.rank-row.me { outline: 2px solid var(--brand); }
.rank-row .rk { width: 26px; text-align: center; font-weight: 900; }
.att-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.att { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.att input { width: 20px; height: 20px; accent-color: var(--green); }
.seg-opt.check { display: block; }
.seg-opt.check input { position: static; opacity: 1; pointer-events: auto; width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; accent-color: var(--brand-dk); }
.seg-opt.check span { display: inline; border: 0; background: none; min-height: 0; padding: 0; font-weight: 700; }
.seg-opt.check input:checked + span { background: none; color: var(--ink); }
.seg-opt.check small { font-weight: 400; color: var(--muted); }

/* ---------- 모임 날 잡기 달력 ---------- */
.month-nav { margin: 4px 0 8px; }
.month-nav b, .month-now { font-family: var(--display); font-weight: 400; font-size: 22px; }
.month-nav small, .month-now small { font-size: 14px; color: var(--muted); }
.month-now { border: 0; background: none; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wh { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.wh.red { color: var(--red); } .wh.blue { color: var(--blue); }
.day {
  --heat: 0; position: relative; min-height: 58px; border-radius: 10px; border: 1.5px solid var(--line);
  background: linear-gradient(rgba(224,49,49,var(--heat)), rgba(224,49,49,var(--heat))), #fff;
  padding: 3px 2px 2px; display: grid; align-content: space-between; justify-items: center; text-align: center;
}
.day.out { border: 0; background: none; }
.day .d { font-weight: 800; font-size: 15px; justify-self: start; padding-left: 4px; }
.day.red .d { color: var(--red); } .day.blue .d { color: var(--blue); }
.day .md { position: absolute; top: 3px; right: 4px; font-size: 10px; font-weight: 800; color: var(--muted); }
.day .hn { font-size: 9px; color: var(--red); line-height: 1.1; max-width: 100%; overflow: hidden; white-space: nowrap; }
.day .sl { display: flex; gap: 2px; font-style: normal; }
.day .sl i { font-style: normal; font-size: 10px; font-weight: 800; line-height: 1.3; padding: 0 3px; border-radius: 5px; }
/* 모임 달력: 그날 주간 조는 주황, 야간 조는 파랑 */
.day .sj, .sj-tag { background: #f28c28; color: #fff; }
.day .sy, .sy-tag { background: #1c64d6; color: #fff; }
.sj-tag, .sy-tag { padding: 1px 8px; border-radius: 999px; font-size: 13px; }
.day .sn { display: none; }
.shift-who { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
/* 넓은 화면(태블릿·PC)에선 칸 안에 주간·야간 동기 이름까지 */
@media (min-width: 600px) {
  .day { min-height: 96px; }
  .day .sn { display: grid; gap: 2px; width: 100%; padding: 0 3px; font-size: 11px; line-height: 1.25; text-align: left; }
  .day .sn > span { border-radius: 5px; padding: 1px 4px; word-break: keep-all; overflow-wrap: break-word; }
  .day .snj { background: #fde3c8; color: #8a4a0b; }
  .day .sny { background: #dbe7fb; color: #123f86; }
}
.day .cnt { display: flex; gap: 3px; font-size: 11px; line-height: 1.2; }
.day .cy { color: var(--green); } .day .cn { color: var(--red); }
.day.past { opacity: .35; }
.day.today { box-shadow: inset 0 0 0 2px var(--brand); }
.day.sel { outline: 3px solid var(--ink); outline-offset: 1px; }
.day.mine-yes.set { background: var(--blue-soft); border: 2.5px solid var(--blue); }
.day.mine-no.set { background: var(--red-soft); border: 2.5px solid var(--red); }
.day.mine-yes.auto { border: 2px dashed #8fb5ec; }
.day.mine-no.auto { border: 2px dashed #ef9a9a; }
.legend { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 0; }
.lgi { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.lg.set-yes { background: var(--blue-soft); border: 2px solid var(--blue); }
.lg.set-no { background: var(--red-soft); border: 2px solid var(--red); }
.lg.auto { border: 2px dashed #999; }
.sel-box { margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--cell); display: grid; gap: 6px; }
.auto-name { color: var(--muted); }
.best-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.best-row:first-of-type { border-top: 0; }
.rank { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 900; flex: none; }
.modes button { font-size: 13px; }
.hours { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.hour { min-height: 48px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; display: grid; line-height: 1.1; }
.hour small { font-size: 10px; color: var(--muted); font-weight: 600; }
.hour[aria-pressed=true] { background: var(--ink); color: #fff; }
.hour[aria-pressed=true] small { color: #ddd; }
.time-show { color: var(--brand-dk); }

/* ---------- 조별 근무표 ---------- */
.ttable { display: grid; gap: 0; margin: 0 -6px; }
.trow { display: grid; grid-template-columns: 38px repeat(7, 1fr); align-items: center; }
.trow.wh .tc { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; }
.trow.wh .tc.red { color: var(--red); } .trow.wh .tc.blue { color: var(--blue); }
.week { border-top: 2px solid var(--line); padding: 2px 0 4px; }
.trow.head { background: #faf6ee; }
.trow.mine { background: #fff7d1; border-radius: 8px; }
.tl { font-size: 13px; font-weight: 800; text-align: center; color: #5a4e40; }
.tc { border: 0; background: none; min-height: 34px; display: grid; place-items: center; padding: 0; position: relative; }
.tc.th { font-weight: 800; font-size: 14px; line-height: 1.05; align-content: center; min-height: 32px; }
.tc.th small { font-size: 9px; font-weight: 600; max-width: 100%; overflow: hidden; white-space: nowrap; }
.tc.th.red { color: var(--red); } .tc.th.blue { color: var(--blue); }
.tc.today { background: #e7f0fd; }
.tc.th.today { box-shadow: inset 0 0 0 2px var(--blue); border-radius: 6px 6px 0 0; }
.tc .chg { position: absolute; top: 3px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.tm { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 900; font-size: 13px; }
.tm.d-bi, .tm.d-hu { background: none; border: 0; width: auto; }
.team-list { padding: 8px 0; border-top: 1px dashed var(--line); }
.team-list:first-of-type { border-top: 0; }
.tl-name { display: block; margin-bottom: 6px; }

/* ---------- 한 사람 달력 ---------- */
.pcal-head { margin-bottom: 6px; }
.pcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pc { min-height: 50px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; display: grid; justify-items: center; align-content: space-between; padding: 3px 0 4px; position: relative; }
.pc.out { border: 0; background: none; }
.pc .pd { font-size: 12px; font-weight: 700; }
.pc .pt { font-size: 13px; font-weight: 900; width: 26px; height: 22px; display: grid; place-items: center; border-radius: 999px; }
.pc.d-ju, .pc.d-ya, .pc.d-hu, .pc.d-bi, .pc.d-ts, .pc.d-yg, .pc.d-ed { background: #fff; color: inherit; border-color: var(--line); }
.pc.d-ju .pt { background: var(--ju); }
.pc.d-ya .pt { background: var(--ya); color: #fff; }
.pc.d-bi .pt, .pc.d-hu .pt { color: var(--red); }
.pc.d-ts .pt { color: var(--blue); width: auto; padding: 0 3px; font-size: 11px; }
.pc.d-yg .pt { color: var(--green); width: auto; padding: 0 3px; font-size: 11px; }
.pc.d-ed .pt { color: #7048b6; width: auto; padding: 0 3px; font-size: 11px; }
.pc.today { box-shadow: inset 0 0 0 2px var(--brand); }
.pc.changed::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
button.pc:active { transform: scale(.96); }

/* ---------- 명부 ---------- */
.day-strip { margin-bottom: 10px; }
.day-now { border: 0; background: none; font-size: 17px; }
.roster { display: grid; gap: 8px; }
.roster-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; padding: 10px; }
.rr-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rr-top { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.rr-sub { font-size: 13px; color: #5a4e40; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 12px 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.logs { margin: 8px 0 0; padding-left: 16px; display: grid; gap: 4px; font-size: 14px; max-height: 320px; overflow: auto; }

/* ---------- 근무 고르기 시트 ---------- */
.duty-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.duty-opt { min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: #fff; }
.duty-opt.on { border-color: var(--ink); }

/* ---------- 회칙 ---------- */
.agenda-link { border-style: solid; }
.rule-ch { padding: 0; overflow: hidden; }
.rule-head { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px; border: 0; background: none; font-size: 16px; text-align: left; }
.rule-head span { font-size: 22px; color: var(--muted); }
.rule { padding: 0 14px 12px; }
.rule + .rule { border-top: 1px dashed var(--line); padding-top: 10px; }
.rule-t { font-weight: 800; margin-bottom: 2px; }
.rule p { margin: 2px 0; font-size: 15px; }

/* ---------- 안건 (다른 페이지 띄우기) ---------- */
.panel.agenda-panel { margin: -12px -16px 0; }
.agenda-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #fffdf8; border-bottom: 1.5px solid var(--line); }
.agenda-frame { display: block; width: 100%; height: calc(100dvh - var(--tabbar) - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 54px); border: 0; background: #fff; }

/* ---------- 시트·페이지·쪽지 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(30,22,14,0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.sheet-wrap.open { background: rgba(30,22,14,.45); }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; transform: translateY(30px); transition: transform .2s; }
.sheet-wrap.open .sheet { transform: none; }
.sheet h2 { font-size: 20px; font-weight: 900; }
.page { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow: auto; }
.page-head { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; background: #fffdf8; border-bottom: 1.5px solid var(--line); padding: env(safe-area-inset-top) 4px 0; min-height: 54px; }
.page-head h1 { text-align: center; font-size: 18px; font-weight: 900; }
.back { border: 0; background: none; font-size: 34px; line-height: 1; height: 48px; }
.page-body { padding: 14px 16px calc(30px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 90; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; max-width: calc(100vw - 32px); transition: .2s; pointer-events: none; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
