/* 院カルテ 共通の見た目。スマホで片手・5分で終わることを最優先にする */
:root {
  --orange: #ff6600;
  --ink: #222;
  --sub: #6b6b6b;
  --line: #e3e3e3;
  --bg: #f6f6f4;
  --card: #fff;
  --ok: #2e8b57;
  --warn: #c0392b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 16px; line-height: 1.6;
}
a { color: var(--orange); }
header.top {
  background: #fff; border-bottom: 3px solid var(--orange); padding: 14px 16px 12px;
  position: sticky; top: 0; z-index: 5;
}
header.top .brand { font-size: 12px; color: var(--sub); letter-spacing: .08em; }
header.top h1 { margin: 2px 0 0; font-size: 19px; line-height: 1.3; }
header.top .meta { font-size: 13px; color: var(--sub); margin-top: 4px; }
main { max-width: 680px; margin: 0 auto; padding: 12px 12px 140px; }
.lead { background: #fff7f0; border: 1px solid #ffd9bf; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 0 0 12px; }
.lead b { color: var(--orange); }
section.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; overflow: hidden;
}
section.card > h2 {
  margin: 0; padding: 14px 16px; font-size: 17px; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
}
section.card > h2 .num {
  background: var(--orange); color: #fff; border-radius: 50%; width: 26px; height: 26px; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
section.card > h2 .chev { margin-left: auto; color: var(--sub); transition: transform .15s; }
section.card.open > h2 .chev { transform: rotate(180deg); }
section.card > .body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line); }
section.card.open > .body { display: block; }
.hint { font-size: 13px; color: var(--sub); margin: 10px 0 6px; }
label.f { display: block; margin: 12px 0 0; font-size: 14px; color: var(--sub); }
label.f span { display: block; margin-bottom: 4px; }
input[type=text], input[type=url], input[type=tel], textarea, select {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
textarea { min-height: 70px; resize: vertical; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.radios label {
  border: 1px solid #ccc; border-radius: 999px; padding: 7px 14px; font-size: 15px; background: #fff; cursor: pointer;
}
.radios input { display: none; }
.radios label:has(input:checked) { border-color: var(--orange); background: var(--orange); color: #fff; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
table.list { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
table.list th { text-align: left; font-size: 12px; color: var(--sub); font-weight: normal; padding: 0 4px 4px; }
table.list td { padding: 3px 2px; vertical-align: top; }
table.list input { padding: 8px 10px; font-size: 15px; }
table.list td.x { width: 34px; text-align: center; }
button {
  font: inherit; font-size: 15px; border-radius: 8px; border: 1px solid #ccc; background: #fff; color: var(--ink); padding: 9px 14px; cursor: pointer;
}
button.mini { padding: 5px 10px; font-size: 13px; }
button.x { border: none; background: none; color: var(--sub); font-size: 20px; line-height: 1; padding: 6px; }
button.add { margin-top: 8px; border-style: dashed; color: var(--sub); width: 100%; }
button.primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.chk input { width: 20px; height: 20px; accent-color: var(--orange); }
.imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 4px; }
.imgs figure { margin: 0; position: relative; border-radius: 8px; overflow: hidden; background: #eee; aspect-ratio: 4/3; }
.imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgs figcaption { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; background: rgba(0,0,0,.5); color: #fff; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imgs .del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 50%; width: 26px; height: 26px; font-size: 16px; padding: 0; }
.imgs .site { outline: 2px dashed #bbb; outline-offset: -2px; }
.imgs .site figcaption { background: rgba(120,120,120,.7); }
.upl { display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--orange); color: var(--orange); border-radius: 8px; padding: 10px 14px; font-size: 15px; cursor: pointer; background: #fff; width: 100%; justify-content: center; }
.upl input { display: none; }
.kindblock { margin-top: 12px; }
.kindblock h3 { margin: 0 0 2px; font-size: 15px; }
.photo { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.photo img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #eee; }
.photo .none { width: 72px; height: 72px; border-radius: 50%; background: #eee; display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: 12px; }
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(0,0,0,.06); z-index: 6;
}
.bar .inner { max-width: 680px; margin: 0 auto; display: grid; gap: 8px; }
.bar .by { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--sub); }
.bar .by input { flex: 1; padding: 8px 10px; font-size: 15px; }
.bar .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bar button { padding: 13px 10px; font-size: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 9; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }
.dirty header.top { border-bottom-color: #ffb27a; }
.badge { display: inline-block; font-size: 12px; border-radius: 999px; padding: 1px 8px; background: #eee; color: var(--sub); vertical-align: middle; }
.badge.warn { background: #fdecea; color: var(--warn); }
.badge.ok { background: #e6f4ea; color: var(--ok); }
.login { max-width: 420px; margin: 12vh auto 0; padding: 0 16px; }
.login .box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; }
.login h1 { font-size: 20px; margin: 0 0 4px; }
.login p { color: var(--sub); font-size: 14px; margin: 0 0 16px; }
.login button { width: 100%; padding: 13px; font-size: 16px; margin-top: 12px; }
.login .err { color: var(--warn); font-size: 14px; min-height: 1.4em; margin-top: 8px; }
.sitecopy { font-size: 12px; color: var(--sub); }
footer.foot { text-align: center; color: var(--sub); font-size: 12px; padding: 24px 0 0; }
@media (min-width: 600px) { .imgs { grid-template-columns: repeat(4, 1fr); } }
