:root {
  --surface-1: #fcfcfb;
  --page-plane: #f6f3ef;
  --text-primary: #1c1a17;
  --text-secondary: #55524c;
  --text-muted: #938d82;
  --gridline: #e6e4dc;
  --baseline: #c3c2b7;
  --border: rgba(20,16,12,0.08);
  --series-1: #2a78d6;
  --good: #0ca30c;
  --warning: #c98500;
  --critical: #d03b3b;
  --brand: #a9765c;
  --brand-dark: #7c5642;
  --brand-tint: #f3e7e0;
  --card-radius: 20px;
  --control-radius: 14px;
  --shadow-xs: 0 1px 2px rgba(28,20,12,0.05);
  --shadow-card: 0 1px 2px rgba(28,20,12,0.04), 0 10px 24px -10px rgba(28,20,12,0.14);
  --shadow-pop: 0 1px 2px rgba(28,20,12,0.05), 0 16px 36px -12px rgba(28,20,12,0.22);
  font-family: -apple-system, system-ui, "SF Pro Text", "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
.app-shell { max-width: 1240px; margin: 0 auto; padding: 20px 20px 60px; }
header.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 20px; }
header.top .brand { display: flex; align-items: center; gap: 10px; }
header.top .brand .mark {
  width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(155deg, #c39274, var(--brand-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-xs);
}
header.top .brand .name { font-weight: 700; font-size: 17px; letter-spacing: .01em; }
header.top .brand .sub { font-size: 12px; color: var(--text-muted); }
header.top a.switch-link { font-size: 12.5px; color: var(--brand-dark); text-decoration: none; font-weight: 600; border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; background: #fff; transition: transform .15s ease, box-shadow .15s ease; }
header.top a.switch-link:active { transform: scale(0.96); }

.banner { background: var(--brand-tint); border: 1px solid var(--border); border-radius: var(--card-radius); padding: 12px 16px; font-size: 12.5px; color: var(--brand-dark); margin-bottom: 18px; line-height: 1.6; }
.access-box { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-card); border-radius: var(--card-radius); padding: 16px; margin-bottom: 16px; }
.access-row { display: flex; gap: 10px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.access-label { flex: 0 0 auto; font-weight: 700; color: var(--text-muted); min-width: 44px; }
.access-map { position: relative; border-radius: 14px; overflow: hidden; margin: 10px 0; border: 1px solid var(--border); }
.access-map iframe { width: 100%; height: 160px; border: 0; display: block; }
.access-map--pin-label iframe { pointer-events: none; }
.map-pin-label { position: absolute; top: 58px; left: 50%; transform: translate(8px, -50%); background: #fff; color: #b3261e; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; border: 1px solid #b3261e; box-shadow: 0 1px 3px rgba(0,0,0,0.15); pointer-events: none; white-space: nowrap; }
.access-map-btn { display: block; text-align: center; font-size: 12.5px; font-weight: 700; color: #fff; border: none; border-radius: 12px; padding: 11px; text-decoration: none; background: var(--brand); transition: transform .15s ease, opacity .15s ease; }
.access-map-btn:active { transform: scale(0.98); opacity: .9; }
.error-banner { background: #fbeaea; border: 1px solid var(--critical); color: #7a1f1f; border-radius: var(--control-radius); padding: 10px 14px; font-size: 12.5px; margin-bottom: 12px; display: none; }
.error-banner.show { display: block; }

/* phone frame (desktop preview) */
.phone-wrap { display: flex; justify-content: center; }
.phone {
  width: 380px; background: #fff; border-radius: 40px; border: 1px solid var(--border);
  box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column; height: 780px;
}
.phone-notch { height: 26px; background: #fff; display: flex; align-items: center; justify-content: center; }
.phone-notch::after { content: ""; width: 90px; height: 6px; background: #e4e2dd; border-radius: 4px; }
.phone-screen { flex: 1; overflow-y: auto; background: var(--surface-1); position: relative; -webkit-overflow-scrolling: touch; }
.phone-tabbar { display: flex; border-top: 1px solid var(--gridline); background: rgba(255,255,255,0.92); backdrop-filter: blur(14px); position: relative; z-index: 5; }
.phone-tabbar button { flex: 1; border: none; background: transparent; padding: 10px 4px 12px; font-size: 10.5px; color: var(--text-muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-weight: 600; transition: color .15s ease, transform .15s ease; }
.phone-tabbar button:active { transform: scale(0.92); }
.phone-tabbar button .ic { width: 23px; height: 23px; display: flex; align-items: center; justify-content: center; }
.phone-tabbar button .ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.phone-tabbar button.active { color: var(--brand); }
.phone-tabbar button.active .ic svg { transform: translateY(-1px) scale(1.06); }

/* real device: fill the screen like a native app, drop the desktop mockup chrome */
@media (max-width: 600px) {
  .app-shell { padding: 0; max-width: none; }
  header.top { padding: max(env(safe-area-inset-top), 14px) 16px 12px; background: rgba(255,255,255,0.92); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
  .phone-wrap { padding: 0; }
  .phone { width: 100%; height: calc(100dvh - 66px); border-radius: 0; border: none; box-shadow: none; }
  .phone-notch { display: none; }
  .phone-tabbar { padding-bottom: env(safe-area-inset-bottom); }
  footer.note { padding: 0 16px 20px; }
}

.cscreen { display: none; padding: 20px 18px 30px; }
.cscreen.active { display: block; animation: screenIn .38s cubic-bezier(.22,.8,.32,1) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cscreen.active { animation: none; }
  * { transition: none !important; }
}

.hero {
  min-height: 168px; border-radius: 24px;
  background: radial-gradient(120% 140% at 15% 0%, #d8ac8c 0%, #a9765c 46%, #6f4a37 100%);
  display: flex; align-items: flex-end; padding: 20px; color: #fff; margin-bottom: 18px;
  box-shadow: var(--shadow-pop); position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 85% 5%, rgba(255,255,255,0.28), transparent 70%);
  pointer-events: none;
}
.hero .h1 { font-size: 23px; font-weight: 700; letter-spacing: .01em; position: relative; }
.hero .h2 { font-size: 12px; opacity: .88; margin-top: 3px; position: relative; }

.quick-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.quick-actions button { flex: 1; background: var(--brand); color: #fff; border: none; border-radius: 999px; padding: 14px 8px; font-size: 13.5px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 18px -8px rgba(169,118,92,0.55); transition: transform .15s ease, box-shadow .15s ease; }
.quick-actions button:active { transform: scale(0.97); box-shadow: 0 4px 10px -6px rgba(169,118,92,0.5); }
.quick-actions button.secondary { background: #fff; color: var(--brand-dark); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }

.section-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 6px 0 12px; letter-spacing: .01em; }

.menu-card, .list-card { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-card); border-radius: var(--card-radius); padding: 15px 16px; margin-bottom: 12px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.menu-card:active, .list-card:active { transform: scale(0.98); }
.menu-card { display: flex; justify-content: space-between; align-items: center; }
.menu-card .mname { font-size: 14px; font-weight: 700; }
.menu-card .mmeta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.menu-card .mprice { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.menu-card input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); margin-right: 12px; }
.menu-row { display: flex; align-items: center; }
.price-col { text-align: right; }
.mdiscount { font-size: 10.5px; font-weight: 700; color: var(--brand-dark); background: var(--brand-tint); border-radius: 7px; padding: 2px 8px; margin-top: 5px; display: inline-block; }

/* お連れ様（複数人でのご来店）関連 */
.companion-card { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-card); border-radius: var(--card-radius); padding: 14px 16px; margin-bottom: 12px; }
.companion-card-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.companion-name-input { flex: 1; min-width: 0; border-radius: var(--control-radius); border: 1px solid var(--border); padding: 10px 12px; font-size: 13px; font-family: inherit; background: var(--page-plane); }
.companion-age-input { flex: 0 0 60px; min-width: 0; border-radius: var(--control-radius); border: 1px solid var(--border); padding: 10px 6px; font-size: 13px; font-family: inherit; background: var(--page-plane); text-align: center; }
.companion-remove-btn { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--page-plane); color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer; }
.companion-menu-list { display: flex; flex-direction: column; gap: 1px; }
.companion-menu-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 2px; cursor: pointer; }
.companion-menu-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); flex: 0 0 auto; margin: 0; }
.companion-menu-name { flex: 1; }
.companion-menu-price { color: var(--brand-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.add-companion-btn { width: 100%; background: #fff; color: var(--brand-dark); border: 1.5px dashed var(--brand); border-radius: var(--card-radius); padding: 13px; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 20px; transition: transform .15s ease; }
.add-companion-btn:active { transform: scale(0.98); }
.companion-tag { font-size: 10.5px; font-weight: 700; color: var(--brand-dark); background: var(--brand-tint); border-radius: 7px; padding: 2px 8px; margin-top: 4px; display: inline-block; cursor: default; }

.step-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 20px; }
.step-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--gridline); transition: background .2s ease, transform .2s ease; }
.step-dots span.on { background: var(--brand); transform: scale(1.15); }

.cal-month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-nav-btn { border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow-xs); border-radius: 10px; width: 32px; height: 32px; font-size: 15px; line-height: 1; cursor: pointer; color: var(--text-primary); transition: transform .15s ease; }
.cal-nav-btn:active { transform: scale(0.92); }
.cal-nav-btn:disabled { color: var(--text-muted); background: var(--page-plane); box-shadow: none; cursor: default; opacity: 0.5; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 20px; }
.cal-grid .dow { font-size: 10.5px; text-align: center; color: var(--text-muted); font-weight: 700; }
.cal-grid button { aspect-ratio: 1; border: 1px solid var(--border); background: #fff; border-radius: 11px; font-size: 12.5px; cursor: pointer; color: var(--text-primary); transition: transform .12s ease, background .15s ease; }
.cal-grid button:disabled { color: var(--text-muted); background: var(--page-plane); cursor: default; }
.cal-grid button.sel { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; box-shadow: 0 6px 14px -6px rgba(169,118,92,0.6); transform: scale(1.04); }

.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 20px; }
.slot-grid button { padding: 12px 4px; border-radius: var(--control-radius); border: 1px solid var(--border); background: #fff; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform .12s ease, background .15s ease; }
.slot-grid button.sel { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; box-shadow: 0 6px 14px -6px rgba(169,118,92,0.6); transform: scale(1.04); }
.slot-grid button:disabled { color: var(--text-muted); background: var(--page-plane); text-decoration: line-through; cursor: default; }

.stylist-row { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; }
.stylist-chip { flex: 0 0 auto; width: 80px; text-align: center; border: 1px solid var(--border); border-radius: var(--card-radius); padding: 12px 6px; cursor: pointer; background: #fff; box-shadow: var(--shadow-xs); transition: transform .15s ease; }
.stylist-chip:active { transform: scale(0.96); }
.stylist-chip.sel { border-color: var(--brand); background: var(--brand-tint); box-shadow: var(--shadow-card); }
.stylist-chip .av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(155deg, #c39274, var(--brand-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 7px; font-size: 13px; }
.stylist-chip .nm { font-size: 11px; font-weight: 700; }
.stylist-chip .rl { font-size: 9.5px; color: var(--text-muted); }

.summary-box { background: var(--brand-tint); border-radius: var(--card-radius); padding: 16px; font-size: 12.5px; margin-bottom: 20px; }
.summary-box .row { display: flex; justify-content: space-between; padding: 5px 0; }
.summary-box .row.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 13.5px; }

.disclaimer-box { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-xs); border-radius: var(--card-radius); padding: 14px 16px; margin-bottom: 14px; max-height: 220px; overflow-y: auto; }
/* 同意書画面は本文がメイン内容のため、短い免責事項ボックスより高さを広く取る */
#consent-box { max-height: 380px; }
.disclaimer-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.disclaimer-body p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 10px; }
.disclaimer-body p:last-child { margin-bottom: 0; }
.disclaimer-body strong { color: var(--text-primary, #333); }
.disclaimer-agree { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 18px; cursor: pointer; }
.disclaimer-agree input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--brand); flex: 0 0 auto; margin-top: 1px; }

.field { margin-bottom: 14px; }
.field label { font-size: 11.5px; color: var(--text-secondary); font-weight: 600; display: block; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; border-radius: var(--control-radius); border: 1px solid var(--border); padding: 11px 12px; font-size: 13.5px; font-family: inherit; background: var(--page-plane); transition: border-color .15s ease, background .15s ease; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); background: #fff; }
.field textarea { height: 68px; resize: none; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.btn-primary { width: 100%; background: var(--brand); color: #fff; border: none; border-radius: 999px; padding: 15px; font-size: 14.5px; font-weight: 700; cursor: pointer; box-shadow: 0 10px 22px -10px rgba(169,118,92,0.6); transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.btn-primary:active { transform: scale(0.97); box-shadow: 0 4px 10px -6px rgba(169,118,92,0.5); }
.btn-primary:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.btn-ghost { width: 100%; background: transparent; color: var(--text-secondary); border: none; padding: 12px; font-size: 12.5px; cursor: pointer; transition: opacity .15s ease; }
.btn-ghost:active { opacity: .6; }

.success-wrap { text-align: center; padding: 44px 10px; }
.success-wrap .check { width: 64px; height: 64px; border-radius: 50%; background: var(--good); color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; box-shadow: 0 10px 24px -8px rgba(12,163,12,0.5); animation: popIn .4s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.member-card, .referral-card {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, #c39274);
  color: #fff; border-radius: 22px; box-shadow: var(--shadow-pop); position: relative; overflow: hidden;
}
.member-card::before, .referral-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 90% at 90% -10%, rgba(255,255,255,0.35), transparent 60%);
  pointer-events: none;
}
.member-card { padding: 18px; margin-bottom: 20px; }
.member-card .rank { font-size: 11px; opacity: .85; position: relative; }
.member-card .pts { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 5px 0; position: relative; }
.member-card .lastvisit { font-size: 11.5px; opacity: .85; position: relative; }

.hist-block { padding: 14px 0; border-bottom: 1px solid var(--gridline); }
.hist-block:last-child { border-bottom: none; }
.hist-item { display: flex; justify-content: space-between; font-size: 12.5px; }
.hist-item .d { color: var(--text-muted); font-size: 11px; }
.badge { font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.badge.done { background: #e7f6e7; color: var(--good); }
.badge.upcoming { background: #eaf1fc; color: var(--series-1); }
.badge.cancel { background: #fbeaea; color: var(--critical); }

.referral-card { padding: 22px 18px; margin-bottom: 20px; text-align: center; }
.referral-card .rf-label { font-size: 11.5px; opacity: .9; position: relative; }
.referral-card .rf-code { font-size: 30px; font-weight: 700; letter-spacing: .12em; margin: 8px 0 16px; font-variant-numeric: tabular-nums; position: relative; }
.referral-card .qr-wrap { background: #fff; border-radius: 14px; padding: 12px; display: inline-block; line-height: 0; box-shadow: var(--shadow-card); position: relative; }
.referral-card .rf-hint { font-size: 11px; opacity: .85; margin-top: 12px; position: relative; }
.referral-card .rf-copy-btn { margin-top: 14px; width: 100%; background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; padding: 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; position: relative; transition: transform .15s ease; }
.referral-card .rf-copy-btn:active { transform: scale(0.97); }
.rf-reward-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--gridline); font-size: 12.5px; }
.rf-reward-item:last-child { border-bottom: none; }
.rf-reward-item .rf-r-name { font-weight: 700; }
.rf-reward-item .rf-r-date { color: var(--text-muted); font-size: 11px; margin-top: 2px; }

/* staff */
.staff-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; }
.side-nav { background: #fff; border: 1px solid var(--border); border-radius: var(--card-radius); padding: 12px; height: fit-content; }
.side-nav button { width: 100%; text-align: left; background: transparent; border: none; padding: 11px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-secondary); cursor: pointer; margin-bottom: 2px; }
.side-nav button.active { background: var(--brand-tint); color: var(--brand-dark); }
.side-nav .logout-btn { margin-top: 10px; border-top: 1px solid var(--gridline); padding-top: 12px; color: var(--critical); }

.staff-panel { display: none; }
.staff-panel.active { display: block; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-tile { background: #fff; border: 1px solid var(--border); border-radius: var(--card-radius); padding: 16px; }
.stat-tile .label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.stat-tile .value { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 6px; }
.stat-tile .delta { font-size: 11.5px; margin-top: 4px; font-weight: 600; }
.stat-tile .delta.good { color: var(--good); }

.panel-card { background: #fff; border: 1px solid var(--border); border-radius: var(--card-radius); padding: 18px; margin-bottom: 18px; }
.panel-card h3 { margin: 0 0 14px; font-size: 14px; }

.stat-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat-grid-2 .panel-card { margin-bottom: 0; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-list .bl-row { display: flex; flex-direction: column; gap: 4px; }
.bar-list .bl-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.bar-list .bl-name { font-weight: 600; color: var(--text-primary); }
.bar-list .bl-val { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bar-list .bl-track { background: var(--page-plane); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-list .bl-fill { background: var(--series-1); height: 100%; border-radius: 999px; }
.bar-list .bl-empty { font-size: 12px; color: var(--text-muted); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.inline-form input, .inline-form select { padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-family: inherit; background: #fff; }
.inline-form input[type="text"] { flex: 1; min-width: 140px; }
.inline-form input[type="number"] { width: 120px; }
.inline-form button { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 12.5px; font-weight: 700; cursor: pointer; }

.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; display: block; }
.thumb-lg { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.photo-pair { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.photo-pair .ph-col { flex: 1; min-width: 140px; }
.photo-pair .ph-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.photo-upload-btn { display: inline-block; font-size: 11.5px; color: var(--brand-dark); border: 1.5px dashed var(--brand); border-radius: var(--control-radius); padding: 9px 10px; text-align: center; cursor: pointer; background: var(--brand-tint); transition: transform .15s ease; }
.photo-upload-btn:active { transform: scale(0.98); }
.photo-upload-btn input { display: none; }

.cell-input { border: 1px solid transparent; border-radius: 6px; padding: 5px 6px; font-size: 12.5px; font-family: inherit; background: transparent; width: 100%; box-sizing: border-box; }
.cell-input:hover, .cell-input:focus { border-color: var(--border); background: #fff; }
.cell-input[type="number"] { width: auto; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--gridline); }
table.data td { padding: 10px; border-bottom: 1px solid var(--gridline); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
td.amt { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr.clickable-row { cursor: pointer; }
table.data tbody tr.clickable-row:hover td { background: var(--page-plane); }

.modal-overlay { position: fixed; inset: 0; background: rgba(20,18,16,0.5); display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; z-index: 100; }
.modal-overlay.hidden { display: none; }
.modal-box { background: #fff; border-radius: var(--card-radius); padding: 20px; max-width: 560px; width: 100%; margin-bottom: 30px; box-shadow: var(--shadow-pop); }
.modal-box h3 { margin: 0 0 14px; font-size: 15px; }
.modal-box .field-row.modal-actions { margin-top: 4px; }
.modal-box .field-row.modal-actions button.btn-ghost { border: 1px solid var(--border); border-radius: 12px; }
.readonly-box { background: var(--page-plane); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.6; }
.readonly-box .ro-title { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.readonly-box img.thumb { margin-top: 4px; }

.status-pill { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
.status-pill.wait { background: #fdf2e2; color: var(--warning); }
.status-pill.visited { background: #e7f6e7; color: var(--good); }
.status-pill.cancel { background: #fbeaea; color: var(--critical); }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
select.status-select { font-size: 12px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--border); background: #fff; }

.chart-wrap { position: relative; }
.bars-svg { width: 100%; height: 220px; display: block; }
.bar-tip { position: absolute; background: var(--text-primary); color: #fff; font-size: 11.5px; padding: 5px 9px; border-radius: 7px; pointer-events: none; opacity: 0; transform: translate(-50%, -110%); transition: opacity .1s; white-space: nowrap; font-variant-numeric: tabular-nums; }

.cust-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
.cust-list { max-height: 460px; overflow-y: auto; }
.cust-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.cust-row:hover, .cust-row.sel { background: var(--brand-tint); }
.cust-row .nm { font-weight: 700; }
.cust-row .lv { font-size: 11px; color: var(--text-muted); }

.karte-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.karte-summary-tile { background: var(--page-plane); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.karte-summary-tile .label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.karte-summary-tile .value { font-size: 16px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

.karte-history { border-left: 2px solid var(--gridline); padding-left: 16px; margin-top: 12px; }
.karte-history .kh-item { margin-bottom: 16px; position: relative; }
.karte-history .kh-item::before { content: ""; position: absolute; left: -21px; top: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.karte-history .kh-date { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.karte-history .kh-menu { font-size: 13px; font-weight: 700; margin: 2px 0; }
.karte-history .kh-memo { font-size: 12px; color: var(--text-secondary); }

/* 顧客カルテ：来店記録を1件ずつ切り替えて表示する形式（左：記録一覧／右：選択中の記録の詳細） */
.karte-history-wrap { display: grid; grid-template-columns: 190px 1fr; gap: 16px; margin-top: 14px; }
.karte-record-list { max-height: 520px; overflow-y: auto; border-right: 1px solid var(--gridline); padding-right: 10px; }
.karte-record-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; }
.karte-record-row:hover, .karte-record-row.sel { background: var(--brand-tint); }
.karte-record-row .kr-date { font-size: 12px; font-weight: 700; }
.karte-record-row .kr-menu { font-size: 11px; color: var(--text-muted); }

.karte-entry-detail { min-width: 0; }
.ked-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.ked-date { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.ked-menu { font-size: 14px; font-weight: 700; }
.ked-memo { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }

.karte-photo-pair-lg { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.karte-photo-pair-lg .ph-col-lg { flex: 1; min-width: 220px; }
.karte-photo-pair-lg .ph-label { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.karte-photo-lg { display: block; width: 100%; height: 260px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.karte-photo-empty { display: flex; align-items: center; justify-content: center; height: 260px; background: var(--page-plane); color: var(--text-muted); font-size: 12px; text-align: center; border-radius: 12px; border: 1px dashed var(--border); box-sizing: border-box; }

.karte-medicine-form { background: var(--page-plane); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.karte-medicine-form .km-title { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }

.shift-grid { display: grid; grid-template-columns: 110px repeat(7, 1fr); gap: 6px; font-size: 11.5px; }
.shift-grid .hd { text-align: center; font-weight: 700; color: var(--text-muted); padding: 6px 2px; border-radius: 8px; }
.shift-grid .hd.hd-closed { background: #fbeaea; color: var(--critical); }
.shift-grid .nm-cell { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 8px 4px; }
.shift-grid .nm-cell .av2 { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.shift-cell { border-radius: 8px; padding: 6px 2px; text-align: center; background: var(--page-plane); color: var(--text-muted); cursor: pointer; border: none; font-size: 11.5px; width: 100%; font-family: inherit; }
.shift-cell.on { background: #eaf1fc; color: var(--series-1); font-weight: 700; }
.shift-cell.off { color: var(--baseline); }

.login-wrap { max-width: 360px; margin: 80px auto; background: #fff; border: 1px solid var(--border); border-radius: var(--card-radius); padding: 28px; }
.login-wrap h2 { margin: 0 0 6px; font-size: 17px; }
.login-wrap p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 18px; }

footer.note { margin-top: 26px; font-size: 11.5px; color: var(--text-muted); text-align: center; }

@media (max-width: 880px) {
  .staff-layout { grid-template-columns: minmax(0, 1fr); }
  .side-nav { display: flex; overflow-x: auto; gap: 4px; }
  .side-nav button { white-space: nowrap; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .cust-grid { grid-template-columns: 1fr; }
  .karte-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .karte-history-wrap { grid-template-columns: 1fr; }
  .karte-record-list { border-right: none; border-bottom: 1px solid var(--gridline); padding-right: 0; padding-bottom: 10px; max-height: 160px; }
}
