@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=Outfit:wght@500;700;800&display=swap");

:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --ink: #12211e;
  --sub: #5b6b67;
  --line: #e1e8e6;
  --brand: #0b7a69;
  --brand-d: #075c4f;
  --brand-l: #e3f3ef;
  --warm: #e8902a;
  --warm-l: #fff3e3;
  --red: #c8423b;
  --red-l: #fdecea;
  --blue: #2c6fd1;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 35, 31, .05), 0 8px 28px rgba(16, 35, 31, .07);
  --num: "Outfit", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", sans-serif;
  font-size: 16px; line-height: 1.7; letter-spacing: .02em;
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- 患者さん画面 ---------- */
.p-wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 56px; }
.p-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 0 14px;
}
.p-logo {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand);
  display: grid; place-items: center; color: #fff; font-weight: 900; flex: none;
}
.p-head h1 { font-size: 17px; margin: 0; line-height: 1.35; }
.p-head small { color: var(--sub); font-size: 12px; display: block; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 20px; margin: 0 0 16px;
}
.card h2 { font-size: 18px; margin: 0 0 12px; }

.status {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #0b7a69 0%, #0e927d 55%, #16a58c 100%);
}
.status.off { background: linear-gradient(135deg, #4f5d5a, #6b7a77); }
.status::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.status .badge {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px;
  background: rgba(255, 255, 255, .16); padding: 4px 12px; border-radius: 99px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #7dffcf; box-shadow: 0 0 0 0 rgba(125, 255, 207, .7); animation: pulse 1.8s infinite; }
.off .dot { background: #cfd6d4; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(125, 255, 207, 0); } 100% { box-shadow: 0 0 0 0 rgba(125, 255, 207, 0); } }
.status .nums { display: flex; gap: 28px; margin-top: 16px; position: relative; z-index: 1; }
.status .nums div { display: flex; flex-direction: column; }
.status .nums b { font-family: var(--num); font-size: 44px; line-height: 1; font-weight: 800; }
.status .nums b small { font-size: 16px; font-weight: 700; margin-left: 4px; font-family: "Noto Sans JP"; }
.status .nums span { font-size: 12px; opacity: .85; margin-top: 6px; }
.status .calling { margin-top: 14px; font-size: 13px; opacity: .9; position: relative; z-index: 1; }

.notice {
  background: var(--warm-l); color: #7a4a10; border-radius: 14px; padding: 12px 14px;
  font-size: 14px; margin: 0 0 16px; display: flex; gap: 10px;
}

.choice { display: grid; gap: 12px; margin-bottom: 16px; }
.choice a {
  display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px;
  border: 2px solid transparent; transition: border-color .2s, transform .2s;
}
.choice a .ic {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--brand-l); color: var(--brand);
}
.choice a.alt .ic { background: #e8f0fb; color: var(--blue); }
.choice a b { display: block; font-size: 17px; }
.choice a b + span { display: block; font-size: 13px; color: var(--sub); line-height: 1.55; }
.choice a .arr { margin-left: auto; color: var(--sub); }
.choice a.disabled { opacity: .5; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .choice a:hover { border-color: var(--brand); transform: translateY(-2px); }
}

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field label .req { color: var(--red); font-size: 11px; margin-left: 6px; border: 1px solid; border-radius: 4px; padding: 0 4px; }
.field label .opt { color: var(--sub); font-size: 11px; margin-left: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px;
  font-size: 16px; background: #fbfcfc; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 122, 105, .12); background: #fff;
}
.field input[type="checkbox"], .field input[type="radio"] { width: auto; padding: 0; margin: 0 4px 0 0; accent-color: var(--brand); }
.field.err input, .field.err textarea { border-color: var(--red); background: var(--red-l); }
.field .hint { font-size: 12px; color: var(--sub); margin-top: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; font-weight: 700;
  margin: 0; cursor: pointer; background: #fbfcfc;
}
.seg input:checked + label { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 15px 20px; font-weight: 700; font-size: 16px;
  background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; width: 100%;
  transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.gray { background: #eef2f1; color: var(--ink); }
.btn.danger { background: transparent; color: var(--red); border: 1.5px solid #efc3c0; }
@media (hover: hover) and (pointer: fine) { .btn:not(:disabled):hover { background: var(--brand-d); } .btn.ghost:hover, .btn.gray:hover, .btn.danger:hover { background: #e9f1ef; } }

.err-box { background: var(--red-l); color: var(--red); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; display: none; }
.err-box.show { display: block; }
.muted { color: var(--sub); font-size: 13px; }
.center { text-align: center; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--sub); text-decoration: none; font-size: 14px; margin: 4px 0 12px; }
.steps { display: flex; gap: 6px; margin: 0 0 14px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--brand); }

/* 受付票 */
.ticket { text-align: center; padding: 28px 20px 24px; position: relative; }
.ticket .lbl { font-size: 13px; color: var(--sub); letter-spacing: .2em; }
.ticket .no { font-family: var(--num); font-size: 96px; line-height: 1.05; font-weight: 800; color: var(--brand); margin: 4px 0 2px; }
.ticket .state { font-size: 20px; font-weight: 900; margin: 6px 0 4px; }
.ticket .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 4px; }
.ticket .meta div { background: var(--bg); border-radius: 14px; padding: 12px; }
.ticket .meta b { display: block; font-family: var(--num); font-size: 30px; line-height: 1.1; }
.ticket .meta span { font-size: 12px; color: var(--sub); }
.ticket.soon { box-shadow: 0 0 0 3px var(--warm), var(--shadow); }
.ticket.soon .no { color: var(--warm); }
.ticket.called { background: var(--brand); color: #fff; animation: glow 1.4s ease-in-out infinite alternate; }
.ticket.called .no, .ticket.called .lbl, .ticket.called .muted { color: #fff; }
@keyframes glow { from { box-shadow: 0 0 0 0 rgba(11, 122, 105, .5); } to { box-shadow: 0 0 0 14px rgba(11, 122, 105, 0); } }
.progress { height: 10px; background: var(--bg); border-radius: 10px; overflow: hidden; margin-top: 14px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2bc3a4); border-radius: 10px; transition: width .8s; }
.tips { font-size: 14px; }
.tips li { margin-bottom: 6px; }
.updated { font-size: 12px; color: var(--sub); text-align: center; margin: 4px 0 14px; }

/* カレンダー・時間枠 */
.menu-list { display: grid; gap: 10px; }
.menu-item {
  text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 16px; cursor: pointer;
}
.menu-item b { display: block; font-size: 16px; }
.menu-item span { font-size: 13px; color: var(--sub); display: block; }
.menu-item.on { border-color: var(--brand); background: var(--brand-l); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .h { text-align: center; font-size: 12px; color: var(--sub); font-weight: 700; }
.cal .h.sat { color: var(--blue); } .cal .h.sun { color: var(--red); }
.cal button {
  aspect-ratio: 1 / 1.08; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-family: var(--num);
}
.cal button b { font-size: 16px; line-height: 1.1; }
.cal button b.m { font-size: 12px; }
.cal button small { font-size: 10px; color: var(--brand); font-family: "Noto Sans JP"; font-weight: 700; }
.cal button:disabled { background: transparent; border-color: transparent; color: #b8c3c0; cursor: default; }
.cal button:disabled small { color: transparent; }
.cal button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cal button.on small { color: #fff; }
.cal .mlabel { grid-column: 1 / -1; font-weight: 700; margin-top: 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slots button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 4px; cursor: pointer;
  font-family: var(--num); font-size: 17px; font-weight: 700; line-height: 1.2;
}
.slots button small { display: block; font-size: 11px; font-family: "Noto Sans JP"; color: var(--brand); font-weight: 500; }
.slots button:disabled { color: #b8c3c0; background: #f6f8f7; cursor: default; }
.slots button:disabled small { color: #b8c3c0; }
.slots button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.slots button.on small { color: #fff; }
.summary { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; font-size: 15px; }
.summary dt { font-size: 12px; color: var(--sub); }
.summary dd { margin: 0 0 8px; font-weight: 700; }
.summary dd:last-child { margin-bottom: 0; }

/* 問診票 */
.q-field { padding: 16px 0 18px; border-top: 1px solid var(--line); margin: 0; }
.q-field:first-child { border-top: 0; }
.q-label { font-size: 15px !important; line-height: 1.55; }
.q-field.err .chips label { border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.two { display: grid; grid-template-columns: 1fr 1fr; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  margin: 0 !important; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 16px; cursor: pointer;
  background: #fbfcfc; font-weight: 500 !important; font-size: 15px !important; text-align: center;
}
.chips.two label { border-radius: 12px; padding: 12px; font-weight: 700 !important; }
.chips input:checked + label { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); font-weight: 700 !important; }
.chips input:focus-visible + label { box-shadow: 0 0 0 4px rgba(11, 122, 105, .18); }
.num-in { display: flex; align-items: center; gap: 8px; }
.num-in input { max-width: 140px; font-family: var(--num); font-size: 20px !important; }
.num-in span { font-weight: 700; }
.q-progress { height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden; margin: 4px 0 6px; }
.q-progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.q-ask { box-shadow: 0 0 0 2px var(--warm), var(--shadow); }

/* LINE・メールのお知らせ */
.btn.line-btn { background: #06c755; }
@media (hover: hover) and (pointer: fine) { .btn.line-btn:not(:disabled):hover { background: #05a647; } }
.ok-line { margin: 0 0 8px; font-weight: 700; color: var(--brand-d); background: var(--brand-l); border-radius: 12px; padding: 10px 14px; }
.line-steps { list-style: none; padding: 0; margin: 14px 0 8px; display: grid; gap: 12px; counter-reset: s; }
.line-steps li { counter-increment: s; background: var(--bg); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.line-steps li > span { font-weight: 700; }
.line-steps li > span::before { content: counter(s); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #06c755; color: #fff; font-size: 13px; margin-right: 8px; }
.code { font-family: var(--num); font-size: 34px; font-weight: 800; letter-spacing: .18em; text-align: center; background: #fff; border-radius: 12px; padding: 6px; }

.foot { text-align: center; font-size: 12px; color: var(--sub); margin-top: 24px; }
.foot b { color: var(--brand); font-family: var(--num); letter-spacing: .08em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #12211e; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50;
  transition: opacity .25s, transform .25s; pointer-events: none; width: max-content; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.fade-in { animation: fadein .45s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
