/* 院長が使う GBP 管理画面。見た目は meo-dash に寄せ（白いヘッダー・分院の帯・左メニュー・グレーの背景に白いカード）、
   色は法人のロゴ（web/icons/logo.png）から取る。ダークモードはなし（2026-11-21 依頼主）。 */
:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f0f1f3; --line: #e6e7e9; --line-2: #d9dbde;
  --ink: #292b2e; --ink-2: #55595f; --ink-3: #6b6f75; --ink-4: #9a9ea4;
  /* ロゴの色 */
  --navy: #1a1c5c; --ruri: #04409a; --blue: #1a67ad; --teal: #0e8a91; --deep-teal: #035664;
  --accent: var(--ruri); --accent-ink: #ffffff; --accent-soft: #e6eef8;
  --teal-soft: #e1f1f2;
  --green: #1f8a5b; --green-soft: #dcf1e6;
  --amber: #a15c00; --amber-soft: #fbecd2;
  --red: #d64545; --red-ink: #b33333; --red-soft: #fdecec;
  --star: #f2a900; --star-off: #d4d6d9;
  --f-body: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, sans-serif;
  --f-num: "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  --r: 10px;
  --head-h: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 700; line-height: 1.35; margin: 0; text-wrap: balance; }
h1 { font-size: 1.45rem; color: var(--navy); } h2 { font-size: 1.05rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); } .small { font-size: .82rem; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.spacer { flex: 1; }
.lbl { display: block; font-size: .75rem; color: var(--ink-3); line-height: 1.4; }

/* ---------- ボタン・入力 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35em; padding: .5em 1em; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.outline { border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--red); }
.btn.sm { padding: .25em .8em; font-size: .8rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: .3rem; }
.field label { font-size: .8rem; color: var(--ink); font-weight: 700; }
.input { width: 100%; padding: .55em .7em; border: 1px solid var(--line-2); border-radius: 4px; background: var(--surface); min-width: 0; }

/* ---------- 部品 ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.notice { background: var(--accent-soft); border-radius: 6px; padding: .75rem 1rem; font-size: .88rem; }
.notice.warn { background: var(--amber-soft); }
.pill { display: inline-block; padding: .05em .55em; border-radius: 3px; font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.wait { background: var(--teal-soft); color: var(--deep-teal); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.err { background: var(--red-soft); color: var(--red-ink); }
.badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 9px; padding: 0 .5em; font-size: .7rem; font-weight: 700; line-height: 1.6; }
.stars { color: var(--star); letter-spacing: .03em; white-space: nowrap; }
.stars .off { color: var(--star-off); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 8px; z-index: 70; font-weight: 700; max-width: calc(100% - 32px); }
.toast.err { background: var(--red); }
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { background: var(--surface); border-radius: var(--r); padding: 1.25rem; width: min(480px, 100%); display: grid; gap: 1rem; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- ログイン前 ---------- */
.landing { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.landing-inner { width: 100%; max-width: 460px; display: grid; gap: 1.25rem; }
.landing .logo-line { display: flex; align-items: center; gap: 14px; }
.landing .logo-line img { width: 56px; height: auto; }
.landing form, .landing .login-box { display: grid; gap: 1rem; }

/* ---------- 外枠：ヘッダー・分院の帯・左メニュー ---------- */
.head { position: sticky; top: 0; z-index: 30; background: var(--surface); height: var(--head-h); display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.head .brand { display: flex; align-items: center; gap: 10px; padding: 0 16px; flex: 1; min-width: 0; text-decoration: none; }
.head .brand img { width: 36px; height: auto; }
.head .brand b { display: block; font-size: 1rem; color: var(--ruri); line-height: 1.2; }
.head .brand small { display: block; font-size: .68rem; color: var(--ink-3); line-height: 1.3; }
.head .head-ico { display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink-2); position: relative; }
.head .head-ico .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.head .menu-btn { display: none; background: var(--ruri); color: #fff; border: 0; width: 60px; height: var(--head-h); cursor: pointer; font-size: .62rem; line-height: 1.2; }
.head .menu-btn .icon { width: 22px; height: 22px; display: block; margin: 0 auto 2px; }

.clinic-bar { background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.clinic-bar > .icon { color: var(--teal); }
.clinic-bar select { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--deep-teal); font-weight: 700; padding: .3em 0; cursor: pointer; }
.clinic-bar .name { color: var(--deep-teal); font-weight: 700; }

.body { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: calc(100vh - var(--head-h) - 37px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; }
.side .sec { padding: 14px 16px 4px; font-size: .72rem; color: var(--ink-3); font-weight: 700; }
.side .nav { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--ink); text-decoration: none; font-size: .88rem; border-left: 3px solid transparent; }
.side .nav:hover { background: var(--surface-2); }
.side .nav.on { background: var(--accent-soft); color: var(--ruri); font-weight: 700; border-left-color: var(--ruri); }
.side-foot { margin-top: auto; padding: 16px; font-size: .78rem; color: var(--ink-2); display: grid; gap: .5rem; justify-items: start; border-top: 1px solid var(--line); }
.side-scrim { display: none; }
.main { padding: 20px 24px 40px; display: grid; gap: 14px; align-content: start; min-width: 0; max-width: 1080px; }
.page-head { display: grid; gap: 2px; }

/* ---------- ホーム：数字のカード ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.stat { border-top: 3px solid var(--c, var(--blue)); border-radius: 0 0 var(--r) var(--r); display: grid; gap: 2px; }
.stat .t { font-weight: 700; font-size: .88rem; }
.stat .v { text-align: right; }
.stat .v b { font-family: var(--f-num); font-size: 1.9rem; font-weight: 700; color: var(--navy); margin-right: 2px; }
.stat .d { text-align: right; font-size: .75rem; color: var(--ink-3); }
.stat .up { color: var(--red); } .stat .down { color: var(--blue); }

/* ---------- 一覧（meo-dash の「項目名の上に値」の行） ---------- */
.list-card { padding: 0; overflow: hidden; }
.list-card .lc-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.list-card .lc-head h2 { flex: 1; }
.lrow { display: grid; gap: 8px 14px; padding: 11px 16px; border-top: 1px solid var(--line); align-items: center; color: var(--ink); text-decoration: none; }
a.lrow:hover { background: #fafbfc; }
.lrow .end { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.lrow .chev { color: var(--ink-4); }
.lrow .wide { min-width: 0; }
.lrow .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-review { grid-template-columns: 110px 100px 100px minmax(0, 1fr) auto; }
.r-post { grid-template-columns: 130px 90px minmax(0, 1fr) 110px auto; }
.r-home-review { grid-template-columns: 1fr 1fr 1fr auto; }
.r-home-post { grid-template-columns: 110px minmax(0, 1fr) auto; }
.empty { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--ink-3); }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.tab { padding: .55rem 1rem; border: 0; border-bottom: 3px solid transparent; background: transparent; cursor: pointer; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tab.on { color: var(--ruri); border-bottom-color: var(--ruri); }
.tab .count { margin-left: .35em; font-family: var(--f-num); font-size: .8em; color: var(--ink-3); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: .65rem 1rem; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: .75rem; color: var(--ink-3); font-weight: 700; background: #fafbfc; }
td.n { text-align: right; font-family: var(--f-num); }

/* ---------- スマホ：左メニューは MENU で開く ---------- */
@media (max-width: 860px) {
  .head .menu-btn { display: block; }
  .head .brand small { display: none; }
  .body { grid-template-columns: 1fr; }
  .side { position: fixed; top: var(--head-h); right: 0; bottom: 0; width: min(280px, 85vw); z-index: 40; transform: translateX(100%); transition: transform .2s; border-right: 0; border-left: 1px solid var(--line); overflow: auto; }
  .side.open { transform: none; }
  .side-scrim.open { display: block; position: fixed; inset: var(--head-h) 0 0 0; background: rgba(10, 20, 30, .35); z-index: 35; }
  .main { padding: 16px 16px 32px; }
  .r-review, .r-post { grid-template-columns: 1fr 1fr; }
  .r-review .wide, .r-post .wide { grid-column: 1 / -1; order: 5; }
  .r-review .end, .r-post .end { grid-column: 1 / -1; order: 6; }
  .r-home-review { grid-template-columns: 1fr 1fr auto; }
  .r-home-review .date { display: none; }
}

/* ---------- 口コミの返信 ---------- */
.back { display: inline-flex; align-items: center; gap: 2px; font-size: .85rem; text-decoration: none; font-weight: 700; justify-self: start; }
.icon.flip { transform: scaleX(-1); }
.review-box, .reply-box { display: grid; gap: 10px; }
.review-text, .reply-text { white-space: pre-wrap; }
.reply-box .reply-text { background: var(--surface-2); border-radius: 6px; padding: 10px 12px; }
textarea.input { resize: vertical; line-height: 1.7; min-height: 9em; }
.check { border-radius: 6px; padding: 10px 14px; display: grid; gap: 8px; font-size: .88rem; }
.check.ok { display: block; background: var(--green-soft); color: var(--green); }
.check.ng { background: var(--red-soft); }
.check.ng > b { color: var(--red-ink); }
.check.warn { background: var(--amber-soft); }
.check.warn > b { color: var(--amber); }
.check .preview { background: var(--surface); border-radius: 4px; padding: 8px 10px; line-height: 1.8; }
.check ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.check li .pill { margin-right: 4px; }
mark { background: transparent; border-bottom: 2px solid; padding: 0 1px; color: inherit; }
mark.ng { background: var(--red-soft); border-color: var(--red); }
mark.warn { background: var(--amber-soft); border-color: var(--amber); }

/* ---------- 共通（2026-11-21 機能追加） ---------- */
[hidden] { display: none !important; }
.flabel { font-size: .8rem; font-weight: 700; }
.form-card { display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid2 .full { grid-column: 1 / -1; }
.grow { flex: 1; min-width: 0; }
.pre { white-space: pre-wrap; display: block; }
.break { word-break: break-all; }
.wrap { white-space: normal; min-width: 12em; }
.tight { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.check-line { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; }
.checks.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.checks label { display: inline-flex; align-items: center; gap: 5px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: .45em .9em; cursor: pointer; font-weight: 700; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ruri); color: #fff; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.sm-select { width: auto; padding: .25em .5em; font-size: .8rem; }
.notice.err { background: var(--red-soft); }
.notice.link { display: block; text-decoration: none; color: var(--ink); }
.notice.row { display: flex; }
.toolbar { gap: 14px; }
.up { color: var(--red); } .down { color: var(--blue); }
.up, .down { white-space: nowrap; font-size: .82rem; }
code { background: var(--surface-2); padding: 0 4px; border-radius: 3px; }
pre.code { background: #1f2430; color: #e8edf3; padding: 12px 14px; border-radius: 6px; overflow: auto; font-size: .8rem; line-height: 1.5; margin: 0; max-height: 420px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tab-body { padding: 16px; display: grid; gap: 14px; }
.form-sections { display: grid; gap: 12px; }
.form-sections h3 { font-size: .95rem; margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 通知 */
.head .head-ico { border: 0; background: transparent; cursor: pointer; }
.notif { position: absolute; top: calc(var(--head-h) - 4px); right: 12px; width: min(360px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 12px; display: grid; gap: 6px; z-index: 50; }
.n-item { display: block; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: .85rem; }
.n-item.err { background: var(--red-soft); } .n-item.warn { background: var(--amber-soft); }

/* 投稿 */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.preview-card { position: sticky; top: calc(var(--head-h) + 12px); display: grid; gap: 8px; }
.pv { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pv img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pv-noimg { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-4); font-size: .85rem; }
.pv-body { padding: 10px 12px; display: grid; gap: 4px; font-size: .88rem; }
.pv-title { font-size: 1rem; }
.pv-cta { justify-self: start; color: var(--blue); font-weight: 700; border: 1px solid var(--line-2); border-radius: 18px; padding: 2px 14px; margin-top: 4px; }
.pv-coupon { background: var(--teal-soft); padding: 4px 8px; border-radius: 4px; }
.r-post2 { grid-template-columns: 56px 130px 80px minmax(0, 1fr) 120px auto; }
.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; background: var(--surface-2); display: block; }
.r-tpl, .r-memo, .r-dl { grid-template-columns: minmax(0, 1fr) auto; }

/* 写真 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ph-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-video { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; padding: 1px 6px; border-radius: 3px; }
.photo figcaption { display: flex; align-items: center; gap: 6px; padding: 6px 8px; flex-wrap: wrap; }
.photo figcaption .btn { margin-left: auto; }
.pf-prev { display: grid; gap: 4px; }
.pf-prev img { max-width: 100%; max-height: 220px; object-fit: contain; border-radius: 6px; background: var(--surface-2); }

/* 店舗情報 */
.hours { display: grid; gap: 8px; }
.hours-row, .sp-row, .svc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hours-row > b { width: 3em; }
.hours-row .input[type=time], .sp-row .input[type=time] { width: 7.5em; }
.sp-row .input[type=date] { width: 11em; }
.sp-list, .svc-list { display: grid; gap: 8px; }
.svc-row .input { flex: 1; min-width: 10em; }

/* 分析 */
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .78rem; color: var(--ink-2); padding: 4px 0 0 44px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; border-top: 1px solid var(--line); padding-top: 10px; }
.bar-row { display: grid; grid-template-columns: 6em 1fr 4em; align-items: center; gap: 8px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--star); }

/* QR・ホームページ */
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr svg { width: 180px; height: 180px; display: block; }
.hp-preview { border: 1px dashed var(--line-2); border-radius: 6px; padding: 12px 16px; overflow-x: auto; }
.print-sheet { display: none; }
@media print {
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { display: block; position: absolute; inset: 0; text-align: center; padding: 30mm 20mm; color: #000; }
  .ps-logo { width: 28mm; }
  .print-sheet h1 { font-size: 30pt; margin: 8mm 0; color: #04409a; }
  .print-sheet p { font-size: 14pt; line-height: 1.9; }
  .ps-qr svg { width: 70mm; height: 70mm; margin: 8mm auto; display: block; }
  .ps-small { font-size: 11pt !important; }
}

@media (max-width: 860px) {
  .compose { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .grid2, .two { grid-template-columns: 1fr; }
  .r-post2 { grid-template-columns: 56px 1fr; }
  .r-post2 .wide, .r-post2 .end { grid-column: 1 / -1; }
  .r-post2 .end { flex-wrap: wrap; }
  .notice.row { flex-wrap: wrap; }
}
