/* 院カルテ 共通の見た目。スマホで片手・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; }
header.top .meta .upd { display: inline-block; background: #fff1e6; color: var(--orange); font-weight: 600; font-size: 14px; border-radius: 999px; padding: 2px 10px; }
main { max-width: 900px; margin: 0 auto; padding: 24px 16px 140px; } /* 上を詰めすぎない（2026-11-06 川畑さん） */
/* オレンジの画面の中で目立つよう紺に（2026-11-06 川畑さん「オレンジ系の中に赤だと目立たない」） */
.autosave { background: #1f3a5f; color: #fff; font-weight: 500; letter-spacing: .02em; font-size: 16px; text-align: center; border-radius: 6px; padding: 13px 16px; margin: 0 0 16px; line-height: 1.5; }
.autosave b { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lead { background: #fff7f0; border: 1px solid #ffd9bf; border-radius: 6px; padding: 12px 16px; font-size: 14px; margin: 0 0 24px; }
.lead b { color: var(--orange); }
section.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 20px; overflow: hidden;
}
section.card > h2 {
  margin: 0; padding: 14px 16px; font-size: 17px; background: var(--orange); color: #fff; letter-spacing: .03em; display: flex; align-items: center; gap: 10px; 
}
section.card > h2 .num {
  background: #fff; color: var(--orange); font-weight: 700; border-radius: 50%; width: 26px; height: 26px; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
section.card > .body { display: block; padding: 0 16px 16px; }
.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; }
div.f { margin: 14px 0 0; font-size: 14px; color: var(--sub); }
div.f > span { display: block; margin-bottom: 4px; }
div.f .radios label { color: var(--ink); }
input[type=text], input[type=url], input[type=tel], input[type=date], textarea, select {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; background: #fff; color: var(--ink);
}
/* 選ぶ欄の矢印を右端から離す（2026-11-06 川畑さん） */
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
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: 18px; }
/* 小見出し：左にオレンジの線＋薄い帯（2026-11-06 川畑さん「見出しの境目が分かりにくい」） */
.kindblock h3 { margin: 0 0 6px; font-size: 15px; background: #fff1e6; border-left: 5px solid var(--orange); padding: 7px 10px; border-radius: 0 6px 6px 0; }
.photo { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
/* サイトの院長・スタッフ写真は縦長の四角（3:4・角丸なし）なので合わせる（2026-11-06 川畑さん） */
.photo img { width: 90px; height: 120px; border-radius: 4px; object-fit: cover; background: #eee; }
.photo .none { width: 90px; height: 120px; border-radius: 4px; 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: 8px 12px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(0,0,0,.06); z-index: 6;
}
.bar .inner { max-width: 900px; margin: 0 auto; display: grid; gap: 5px; }
.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; gap: 8px; }
.bar button { padding: 10px 8px; font-size: 15px; }
.bar #status { justify-content: center; font-size: 11px; line-height: 1.4; text-align: center; }
.bar #status.warn { color: #c0392b; font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: 100px; 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); } }

/* ── ノートPC（13〜14インチ）向け: 固定のヘッダーとフッターを1行に畳む ──
   スマホ前提の縦積みだと、上下の固定帯だけで画面の1/3を食う（2026-09-07 川畑さん） */
@media (min-width: 700px) {
  header.top { padding: 8px 20px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
  header.top .brand { font-size: 12px; }
  header.top h1 { font-size: 17px; margin: 0; }
  header.top .meta { margin: 0 0 0 auto; font-size: 12px; }
  main { padding: 24px 16px 84px; }
  .lead { font-size: 13px; padding: 10px 14px; margin-bottom: 24px; }
  section.card > h2 { padding: 10px 14px; font-size: 16px; }
  section.card > .body { padding: 0 14px 12px; }
  label.f { margin-top: 8px; }
  input[type=text], input[type=url], input[type=tel], textarea, select { padding: 7px 10px; font-size: 15px; }
  .bar { padding: 8px 16px; }
  /* PC は 1 行：左に自動保存の表示、右にボタン 2 つ（2026-09-27 帯を小さくしたのに合わせて組み直し） */
  .bar .inner { display: grid; grid-template-columns: 1fr 220px; grid-template-areas: "s b"; column-gap: 16px; align-items: center; }
  .bar #status { grid-area: s; justify-content: flex-start; text-align: left; font-size: 12px; }
  .bar .btns { grid-area: b; }
  .bar button { padding: 9px 12px; font-size: 15px; }
}
