/* 保育園・幼稚園 業務支援アプリ 共通の見た目（職員 s.html・保護者 index.html）
   UI規約: 文字は rem・高さは min-height・折り返し可・タップ44px以上・文字200%でも崩れない
   制作・運営: 旗二でじたる */
:root {
  --bg: #fbf8f2; --card: #ffffff; --ink: #2b2b2b; --sub: #5f5a52; --line: #e4ddd0;
  --main: #2f7d5b; --main-d: #22604a; --main-l: #e5f2ea;
  --warn: #c0392b; --warn-l: #fbe9e7; --sun: #e08a1e; --sun-l: #fdf1df; --blue: #2c6aa0; --blue-l: #e6f0f8;
}
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; font-size: 1.05rem; line-height: 1.6; overflow-wrap: break-word; word-break: normal; }
main { max-width: 46rem; margin: 0 auto; padding: 0.75rem 1rem 2rem; }
h1 { font-size: 1.35rem; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0.5rem 0; }
.sub { color: var(--sub); font-size: 0.95rem; }
.small { font-size: 0.9rem; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 1rem; }
.back { min-height: 2.75rem; padding: 0.4rem 0.9rem; border: 1px solid var(--line); background: var(--card); border-radius: 0.6rem; font-size: 1rem; color: var(--ink); cursor: pointer; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.head .en { font-weight: 700; font-size: 1.15rem; }
.pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 1rem; background: var(--main-l); color: var(--main-d); font-size: 0.9rem; }

.tiles { display: flex; flex-direction: column; gap: 0.75rem; }
.tile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%; min-height: 4rem; padding: 0.9rem 1.1rem; border: 2px solid var(--line); border-radius: 0.9rem; background: var(--card); color: var(--ink); font-size: 1.15rem; font-weight: 700; text-align: left; cursor: pointer; text-decoration: none; }
.tile.main { background: var(--main); border-color: var(--main); color: #fff; font-size: 1.25rem; min-height: 5rem; }
.tile.alert { border-color: var(--warn); background: var(--warn-l); }
.tile.main.alert { background: var(--warn); border-color: var(--warn); color: #fff; }
.tile .note { font-weight: 400; font-size: 0.95rem; color: inherit; opacity: 0.9; }
.badge { display: inline-block; min-width: 1.8rem; padding: 0.1rem 0.55rem; border-radius: 1rem; background: var(--warn); color: #fff; font-size: 0.95rem; text-align: center; font-weight: 700; }
.badge.soft { background: var(--sun); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0.5rem 1.1rem; border: 2px solid var(--main); border-radius: 0.7rem; background: var(--main); color: #fff; font-size: 1.05rem; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.btn.ghost { background: var(--card); color: var(--main-d); }
.btn.warn { background: var(--warn); border-color: var(--warn); }
.btn.warn.ghost { background: var(--card); color: var(--warn); }
.btn.big { width: 100%; min-height: 3.6rem; font-size: 1.2rem; }
.btn:disabled { opacity: 0.5; cursor: default; }
.row-btns { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.75rem 0; }
.row-btns .btn { flex: 1 1 9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 0.9rem; padding: 0.9rem 1rem; margin: 0 0 0.75rem; }
.card.warn { border: 2px solid var(--warn); background: var(--warn-l); }
.card.sun { border: 2px solid var(--sun); background: var(--sun-l); }
.card.ok { border: 2px solid var(--main); background: var(--main-l); }

.list { display: flex; flex-direction: column; gap: 0.5rem; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-height: 3.4rem; padding: 0.55rem 0.8rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; }
.item .grow { flex: 1 1 10rem; min-width: 0; }
.item .name { font-weight: 700; font-size: 1.1rem; }
.item.tap { cursor: pointer; }
.item.red { border: 2px solid var(--warn); background: var(--warn-l); }
.item.sun { border: 2px solid var(--sun); background: var(--sun-l); }
.item.gray { opacity: 0.75; }
.item .btn { min-height: 2.75rem; padding: 0.35rem 0.9rem; }
.sec-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.1rem 0 0.5rem; font-weight: 700; }

label.f { display: block; margin: 0.9rem 0 0.3rem; font-weight: 700; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month], input[type=password], select, textarea {
  width: 100%; min-height: 2.9rem; padding: 0.45rem 0.7rem; border: 2px solid var(--line); border-radius: 0.6rem; background: #fff; font-size: 1.1rem; font-family: inherit; color: var(--ink);
}
textarea { min-height: 6rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pin { font-size: 1.8rem; letter-spacing: 0.4em; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { min-height: 2.9rem; padding: 0.4rem 1rem; border: 2px solid var(--line); border-radius: 2rem; background: #fff; font-size: 1.05rem; cursor: pointer; color: var(--ink); }
.chip.on { border-color: var(--main); background: var(--main); color: #fff; font-weight: 700; }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 2.9rem; cursor: pointer; }
.check input { width: 1.5rem; height: 1.5rem; flex: none; }

.msg { padding: 0.7rem 0.9rem; border-radius: 0.6rem; margin: 0.75rem 0; }
.msg.err { background: var(--warn-l); color: #8e2a1f; border: 1px solid var(--warn); }
.msg.info { background: var(--blue-l); color: #1f4f78; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.5rem 0.9rem; margin: 0.75rem 0; }
summary { min-height: 2.75rem; display: flex; align-items: center; cursor: pointer; font-weight: 700; }

.qr { width: min(16rem, 80vw); margin: 0.5rem auto; display: block; }
.qr svg { width: 100%; height: auto; display: block; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; word-break: break-all; background: #f3efe6; padding: 0.4rem 0.6rem; border-radius: 0.4rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.5rem; }
.ph { position: relative; aspect-ratio: 1 / 1; background: #eee; border-radius: 0.6rem; overflow: hidden; border: 0; padding: 0; cursor: pointer; }
.ph img, img.nosave { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
img.full { width: 100%; height: auto; border-radius: 0.6rem; }
.ph .del { position: absolute; right: 0.3rem; bottom: 0.3rem; }

.item.nap { flex-direction: column; align-items: stretch; gap: 0.4rem; }
.item.nap .grow { flex: none; }
.nap .row-btns { margin: 0.3rem 0 0; }
.nap .row-btns .btn { flex: 1 1 6rem; }
.timer { font-weight: 700; }
.timer.late { color: var(--warn); }

table.t { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: #fff; }
table.t th, table.t td { border: 1px solid var(--line); padding: 0.3rem 0.4rem; text-align: left; vertical-align: top; }
table.t th { background: #f3efe6; }
.scroll { overflow-x: auto; }

#toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(8rem); display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; max-width: calc(100% - 2rem); padding: 0.75rem 1rem; background: #2b2b2b; color: #fff; border-radius: 0.8rem; transition: transform 0.25s; z-index: 50; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast .toast-act { min-height: 2.75rem; padding: 0.3rem 0.8rem; border: 1px solid #fff; background: transparent; color: #fff; border-radius: 0.5rem; font-size: 1rem; cursor: pointer; }

.trial-band { background: #6b4fa0; color: #fff; text-align: center; padding: 0.45rem 1rem; font-weight: 700; font-size: 0.95rem; }
footer.credit { text-align: center; color: var(--sub); font-size: 0.85rem; padding: 1.5rem 1rem 2rem; }

/* はじめてカード・控えの紙の印刷 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.pcard { border: 2px dashed #999; border-radius: 0.6rem; padding: 0.8rem; background: #fff; break-inside: avoid; page-break-inside: avoid; }
.pcard .qr { width: 9rem; }
.pcard .who { font-size: 1.2rem; font-weight: 700; }

@media print {
  body { background: #fff; font-size: 10.5pt; }
  .noprint, .bar, #toast, footer.credit { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { border: 1px solid #999; }
  table.t { font-size: 8.5pt; }
}
