/* ============================================================
   단골벨 디자인 시스템 — 컴포넌트 + 앱 셸
   theme.css의 토큰을 사용. 클래스 이름은 rv- 접두사.
   ============================================================ */

/* ---- Button ---- */
.rv-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:var(--font-sans); font-weight:var(--weight-bold); letter-spacing:var(--tracking-normal);
  border:none; cursor:pointer; text-decoration:none; color:inherit;
  border-radius:var(--radius-md); white-space:nowrap; -webkit-tap-highlight-color:transparent; user-select:none;
  transition:background-color .12s ease, transform .06s ease, box-shadow .12s ease, filter .12s ease, border-color .12s ease; }
.rv-btn:active{ transform:translateY(1px); }
.rv-btn:disabled,.rv-btn[aria-disabled="true"]{ opacity:.4; cursor:not-allowed; transform:none; filter:none; }
.rv-btn--full{ width:100%; }
.rv-btn--lg{ min-height:var(--control-h); padding:0 24px; font-size:var(--text-md); }
.rv-btn--md{ min-height:var(--control-h-sm); padding:0 18px; font-size:var(--text-base); }
.rv-btn--sm{ min-height:48px; padding:0 14px; font-size:var(--text-sm); border-radius:var(--radius-sm); gap:6px; }
.rv-btn--primary{ background:var(--action-primary); color:var(--action-primary-text); box-shadow:var(--shadow-sm); }
.rv-btn--primary:hover{ background:var(--action-primary-hover); }
.rv-btn--dark{ background:var(--action-dark); color:var(--text-on-dark); box-shadow:var(--shadow-sm); }
.rv-btn--dark:hover{ background:var(--action-dark-hover); }
.rv-btn--secondary{ background:var(--surface); color:var(--ink-900); box-shadow:inset 0 0 0 1.5px var(--border-strong); }
.rv-btn--secondary:hover{ background:var(--surface-sunken); }
.rv-btn--soft{ background:var(--rv-soft-bg); color:var(--rv-soft-fg); }
.rv-btn--soft:hover{ filter:brightness(.96); }
.rv-btn--ghost{ background:transparent; color:var(--rv-soft-fg); }
.rv-btn--ghost:hover{ background:var(--rv-soft-bg); }
.rv-tone-brand{   --rv-soft-bg:var(--brand-bg);   --rv-soft-fg:var(--brand-fg); }
.rv-tone-success{ --rv-soft-bg:var(--success-bg); --rv-soft-fg:var(--success-fg); }
.rv-tone-danger{  --rv-soft-bg:var(--danger-bg);  --rv-soft-fg:var(--danger-fg); }
.rv-tone-warning{ --rv-soft-bg:var(--warning-bg); --rv-soft-fg:var(--warning-fg); }
.rv-tone-neutral{ --rv-soft-bg:var(--neutral-bg); --rv-soft-fg:var(--neutral-fg); }

/* ---- Card ---- */
.rv-card{ background:var(--surface-card); border:1px solid var(--border-default);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:var(--pad-card); }
.rv-card--emphasis{ border:2px solid var(--brand-500); box-shadow:var(--shadow-md); }
.rv-card__head{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.rv-card__title{ font-size:var(--text-lg); font-weight:var(--weight-bold); color:var(--ink-900);
  display:flex; align-items:center; gap:9px; letter-spacing:var(--tracking-tight); line-height:var(--leading-snug); }
.rv-card__title-icon{ display:flex; flex:none; }
.rv-card__action{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.rv-accent-brand{ color:var(--brand-600); } .rv-accent-warning{ color:var(--amber-600); }
.rv-accent-success{ color:var(--green-600); } .rv-accent-danger{ color:var(--red-600); }
.rv-accent-accent{ color:var(--rose-600); } .rv-accent-neutral{ color:var(--ink-600); }

/* ---- Badge ---- */
.rv-badge{ display:inline-flex; align-items:center; gap:5px; font-weight:var(--weight-bold);
  border-radius:var(--radius-pill); white-space:nowrap; line-height:1; }
.rv-badge--sm{ font-size:var(--text-xs); padding:5px 10px; }
.rv-badge--md{ font-size:var(--text-sm); padding:7px 12px; }
.rv-badge--brand{   background:var(--brand-bg);   color:var(--brand-fg); }
.rv-badge--success{ background:var(--success-bg); color:var(--success-fg); }
.rv-badge--warning{ background:var(--warning-bg); color:var(--warning-fg); }
.rv-badge--danger{  background:var(--danger-bg);  color:var(--danger-fg); }
.rv-badge--accent{  background:var(--accent-bg);  color:var(--accent-fg); }
.rv-badge--info{    background:var(--info-bg);    color:var(--info-fg); }
.rv-badge--neutral{ background:var(--neutral-bg); color:var(--neutral-fg); }
.rv-badge--dark{    background:var(--ink-950);    color:var(--dark-fg); }
.rv-badge--solid-dark{    background:var(--ink-950);   color:var(--dark-fg); }
.rv-badge--solid-neutral{ background:var(--ink-700);   color:#fff; }
.rv-badge--solid-success{ background:var(--green-600); color:#fff; }

/* ---- StatCard ---- */
.rv-stat{ background:var(--surface-sunken); border:1px solid var(--border-soft);
  border-radius:var(--radius-lg); padding:15px 16px 17px; display:flex; flex-direction:column; gap:7px;
  min-height:108px; justify-content:space-between; }
.rv-stat__label{ font-size:var(--text-sm); font-weight:var(--weight-semibold); color:var(--ink-600);
  display:flex; align-items:center; gap:7px; }
.rv-stat__value{ font-size:var(--stat-md); font-weight:var(--weight-extrabold); line-height:var(--leading-number);
  color:var(--ink-900); letter-spacing:var(--tracking-tight); font-variant-numeric:tabular-nums; }
/* 누를 수 있는 지표 카드 — 숫자 옆 화살표로 '눌러서 볼 수 있음'을 알림(반응 없어 직접 찾아가는 일 방지) */
.rv-stat--tap{ width:100%; text-align:left; font-family:var(--font-sans); cursor:pointer;
  -webkit-tap-highlight-color:transparent; transition:background .12s, border-color .12s, transform .06s; }
.rv-stat--tap:hover{ background:var(--surface); border-color:var(--border-strong); }
.rv-stat--tap:active{ transform:scale(.98); }
.rv-stat--tap .rv-stat__value{ display:flex; align-items:baseline; }
.rv-stat__go{ margin-left:auto; align-self:center; display:flex; color:var(--ink-400); flex:none; }
.rv-stat__unit{ font-size:var(--text-md); font-weight:var(--weight-bold); color:var(--ink-600); margin-left:3px; }
.rv-stat--warning{ background:var(--warning-bg); border-color:var(--amber-100); }
.rv-stat--warning .rv-stat__label, .rv-stat--warning .rv-stat__value{ color:var(--amber-700); }
.rv-stat--warning .rv-stat__unit{ color:var(--amber-600); }
.rv-stat--success .rv-stat__value{ color:var(--green-700); }
.rv-stat--brand .rv-stat__value{ color:var(--brand-600); }
.rv-stat--accent{ background:var(--accent-bg); border-color:var(--rose-100); }
.rv-stat--accent .rv-stat__label, .rv-stat--accent .rv-stat__value{ color:var(--rose-700); }
.rv-stat--accent .rv-stat__unit{ color:var(--rose-600); }

/* ---- ListRow ---- */
.rv-row{ display:flex; align-items:center; gap:12px; padding:14px 0;
  border-bottom:1px solid var(--border-soft); min-height:var(--row-min);
  /* 폭 좁은 행(버튼 2개+ 등)에서 액션 버튼을 아래 줄로 내려 시간·이름이 어색하게 갈라지지 않게 */
  flex-wrap:wrap; row-gap:10px; }
:root[data-fs-large] .rv-row__body{ min-width:58%; }
.rv-row:last-child{ border-bottom:none; }
.rv-row__lead{ flex:none; display:flex; align-items:center; justify-content:center; }
.rv-row__body{ min-width:56%; flex:1; }
.rv-row__title{ font-size:var(--text-md); font-weight:var(--weight-semibold); color:var(--ink-900);
  display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.rv-row__sub{ font-size:var(--text-sm); color:var(--ink-600); margin-top:4px; line-height:var(--leading-snug);
  display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.rv-row__trail{ margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  justify-content:flex-end; flex:none; }
.rv-avatar{ width:44px; height:44px; border-radius:999px; flex:none; display:flex; align-items:center;
  justify-content:center; background:var(--surface-sunken); color:var(--ink-600);
  font-weight:800; font-size:var(--text-md); }
.rv-avatar--brand{ background:var(--brand-bg); color:var(--brand-600); }
.rv-avatar--warning{ background:var(--warning-bg); color:var(--amber-600); }
.rv-avatar--accent{ background:var(--accent-bg); color:var(--rose-600); }

/* ---- MessageBubble ---- */
.rv-msg{ padding:16px 0; border-bottom:1px solid var(--border-soft); }
.rv-msg:last-child{ border-bottom:none; }
.rv-msg__top{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:3px; }
.rv-msg__name{ font-size:var(--text-md); font-weight:800; color:var(--ink-900); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rv-msg__sub{ font-size:var(--text-sm); color:var(--ink-500); margin-bottom:10px; }
.rv-msg__body{ font-size:var(--text-base); line-height:var(--leading-normal); color:var(--ink-900);
  background:var(--surface-sunken); border:1px solid var(--border-soft);
  border-radius:5px 16px 16px 16px; padding:13px 15px; white-space:pre-wrap; }
.rv-msg--failed .rv-msg__body{ background:var(--danger-bg); border-color:var(--red-100); }
.rv-msg__actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:9px; }

/* ---- 발송함 날짜 헤더 (카톡 관습대로 스크롤 시 상단 고정 — 지금 어느 날짜를 보는지 유지) ----
   스크롤 컨테이너는 #main(앱 셸 내부) — appbar는 셸에 있어 안 사라지므로 top:0이 곧 appbar 바로 아래. */
.rv-dayhead{ font-size:var(--text-md); font-weight:800; color:var(--ink-900); padding:10px 0 8px;
  position:sticky; top:0; z-index:2; background:var(--surface); }
.rv-dayhead--warn{ color:var(--red-600); }
.rv-dayhead--past{ font-size:var(--text-sm); font-weight:700; color:var(--ink-500); padding:18px 0 8px; margin-top:8px; border-top:1px solid var(--border-soft); }

/* ---- EmptyState ---- */
.rv-empty{ text-align:center; color:var(--text-muted); font-size:var(--text-base);
  padding:28px 16px; display:flex; flex-direction:column; align-items:center; gap:12px; }
.rv-empty__icon{ width:52px; height:52px; border-radius:var(--radius-pill);
  background:var(--surface-sunken); color:var(--ink-400); display:flex; align-items:center; justify-content:center; }

/* ---- Field (input / textarea / select) ---- */
.rv-field{ display:block; width:100%; }
.rv-field__label{ display:block; font-size:var(--text-sm); font-weight:var(--weight-semibold);
  color:var(--ink-700); margin-bottom:8px; }
.rv-field__req{ color:var(--red-600); margin-left:2px; }
.rv-field__hint{ font-size:var(--text-sm); color:var(--ink-600); margin-top:8px; line-height:var(--leading-snug); }
.rv-field__wrap{ position:relative; display:flex; align-items:center; }
.rv-field__icon{ position:absolute; left:16px; color:var(--ink-400); pointer-events:none; display:flex; }
.rv-field__control{ width:100%; font-family:var(--font-sans); font-size:var(--text-base); font-weight:var(--weight-medium);
  color:var(--ink-900); background:var(--surface); letter-spacing:var(--tracking-normal);
  border:1.5px solid var(--border-strong); border-radius:var(--radius-md);
  padding:0 16px; min-height:var(--control-h); transition:border-color .12s ease, box-shadow .12s ease; }
.rv-field__wrap--icon .rv-field__control{ padding-left:48px; }
textarea.rv-field__control{ padding:14px 16px; min-height:96px; line-height:var(--leading-normal); resize:vertical; }
.rv-field__control::placeholder{ color:var(--ink-400); }
.rv-field__control:hover{ border-color:var(--ink-400); }
.rv-field__control:focus{ outline:none; border-color:var(--brand-500); box-shadow:var(--focus-ring); }
.rv-field__control:disabled{ background:var(--surface-sunken); color:var(--ink-400); cursor:not-allowed; }
select.rv-field__control{ appearance:none; -webkit-appearance:none; cursor:pointer; padding-right:46px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 16px center; }

/* ---- 단골 검색 드롭다운 (이름 칸 아래) — 같은 이름도 뒤 4자리로 구분 ---- */
.rv-sugg{ position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:30; background:var(--surface);
  border:1.5px solid var(--border-strong); border-radius:var(--radius-md);
  box-shadow:var(--shadow-md); max-height:236px; overflow-y:auto; }
.rv-sugg__item{ display:flex; justify-content:space-between; align-items:center; gap:10px; width:100%; text-align:left;
  min-height:56px; padding:10px 14px; border:0; border-bottom:1px solid var(--border-soft); background:var(--surface);
  font-family:var(--font-sans); font-size:var(--text-base); cursor:pointer; }
.rv-sugg__item:last-child{ border-bottom:0; }
.rv-sugg__item:active{ background:var(--surface-sunken); }
.rv-sugg__main{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.rv-sugg__name{ color:var(--ink-900); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rv-sugg__sub{ color:var(--ink-500); font-size:var(--text-sm); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rv-sugg__tail{ color:var(--ink-600); font-weight:var(--weight-bold); flex:none; }

/* ---- AppBar ---- */
.rv-appbar{ position:sticky; top:0; z-index:20; display:flex; align-items:center; gap:12px;
  min-height:var(--appbar-h); padding:12px var(--pad-screen); background:var(--surface);
  border-bottom:1px solid var(--border-default);
  padding-top:max(12px, env(safe-area-inset-top, 0px)); }   /* 아이폰: 상태바 바로 아래 붙게(합산하면 너무 두꺼움), 그 외: 12px */
.rv-hasdemo .rv-appbar{ padding-top:12px; }   /* 데모바가 위에 있으면 인셋은 데모바 몫 */
.rv-appbar__lead{ flex:none; display:flex; align-items:center; }
.rv-appbar__titles{ min-width:0; }
.rv-appbar__title{ font-size:var(--text-lg); font-weight:var(--weight-bold); color:var(--ink-900);
  line-height:1.2; letter-spacing:var(--tracking-tight); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-appbar__sub{ font-size:var(--text-sm); color:var(--ink-600); margin-top:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-appbar__trail{ margin-left:auto; flex:none; display:flex; align-items:center; gap:6px; }

/* ---- TabBar ---- */
/* sticky bottom:0 은 '스크롤포트' 기준인데 아이폰 홈화면 앱에선 그게 852가 아닌 793으로 잡혀
   탭바가 화면 바닥에서 59pt 떠 있었다. 탭바는 flex 컬럼의 마지막 요소라 sticky 없이도 바닥에 붙는다. */
.rv-tabbar{ position:relative; z-index:20; display:flex; background:var(--surface);
  border-top:1px solid var(--border-default); box-shadow:var(--shadow-nav);
  padding-bottom:env(safe-area-inset-bottom, 0px); }   /* 홈 표시줄 자리 확보(표준) */
.rv-tabbar__item{ position:relative; flex:1; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:4px; min-height:var(--tabbar-h); padding:8px 4px;
  border:none; background:none; cursor:pointer; color:var(--ink-400);
  font-family:var(--font-sans); font-size:var(--text-sm); font-weight:var(--weight-semibold);
  letter-spacing:var(--tracking-normal); -webkit-tap-highlight-color:transparent; transition:color .12s ease; }
.rv-tabbar__item:hover{ color:var(--ink-600); }
.rv-tabbar__item--active{ color:var(--brand-600); }
.rv-tabbar__item--active .rv-tabbar__label{ font-weight:var(--weight-bold); }
.rv-tabbar__item--active::before{ content:""; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:34px; height:3px; border-radius:0 0 3px 3px; background:var(--brand-500); }
.rv-tabbar--rail{ flex-direction:column; gap:4px; background:transparent; border-top:none; box-shadow:none; padding:0; }
.rv-tabbar--rail .rv-tabbar__item{ flex-direction:row; justify-content:flex-start; gap:12px; min-height:54px;
  padding:0 16px; border-radius:var(--radius-md); font-size:var(--text-md); }
.rv-tabbar--rail .rv-tabbar__item--active{ background:var(--brand-50); }
.rv-tabbar--rail .rv-tabbar__item--active::before{ top:50%; left:0; transform:translateY(-50%);
  width:3px; height:26px; border-radius:0 3px 3px 0; }

/* ---- Segmented ---- */
.rv-seg{ display:inline-flex; gap:4px; padding:4px; background:var(--surface-sunken);
  border:1px solid var(--border-soft); border-radius:var(--radius-md); }
.rv-seg--full{ display:flex; width:100%; }
.rv-seg__item{ flex:1; border:none; cursor:pointer; background:transparent; color:var(--ink-600);
  font-family:var(--font-sans); font-weight:var(--weight-bold); font-size:var(--text-sm);
  min-height:44px; padding:0 14px; border-radius:var(--radius-sm); white-space:nowrap; transition:background .12s ease, color .12s ease; }
.rv-seg--lg .rv-seg__item{ min-height:48px; font-size:var(--text-base); }
.rv-seg__item--active{ background:var(--surface); color:var(--brand-600); box-shadow:var(--shadow-xs); }

/* ---- Toggle ---- */
.rv-toggle{ display:inline-flex; align-items:center; gap:9px; border:none; background:none; cursor:pointer;
  min-height:44px; font-family:var(--font-sans); font-weight:700; font-size:var(--text-sm); color:var(--ink-700); white-space:nowrap; }
.rv-toggle__track{ width:46px; height:28px; border-radius:999px; background:var(--border-strong);
  position:relative; transition:background .15s ease; flex:none; }
.rv-toggle__track--on{ background:var(--brand-500); }
.rv-toggle__knob{ position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:999px;
  background:#fff; box-shadow:var(--shadow-xs); transition:left .15s ease; }
.rv-toggle__track--on .rv-toggle__knob{ left:21px; }

/* ---- Modal ---- */
.rv-modal__backdrop{ position:fixed; inset:0; z-index:60; background:rgba(15,17,21,.5);
  display:flex; align-items:flex-end; justify-content:center; padding:0; animation:rvfade .15s ease; }
.rv-modal{ width:100%; max-width:440px; max-height:90dvh; background:var(--surface);
  border-radius:var(--radius-2xl) var(--radius-2xl) 0 0; display:flex; flex-direction:column;
  box-shadow:var(--shadow-lg); animation:rvsheet .2s ease; }
.rv-modal__head{ display:flex; align-items:center; gap:10px; padding:18px 18px 12px; }
.rv-modal__title{ font-size:var(--text-lg); font-weight:800; color:var(--ink-900); letter-spacing:var(--tracking-tight); }
.rv-modal__close{ margin-left:auto; flex:none; width:44px; height:44px; border:none; background:var(--surface-sunken);
  color:var(--ink-600); border-radius:999px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.rv-modal__close:hover{ background:var(--neutral-bg); }
.rv-modal__body{ padding:0 18px 22px; overflow-y:auto; -webkit-overflow-scrolling:touch; }
@keyframes rvfade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes rvsheet{ from{ transform:translateY(24px); opacity:.6; } to{ transform:translateY(0); opacity:1; } }
.rv-modal__backdrop--noanim, .rv-modal--noanim{ animation:none; }   /* 내용 갱신 시 등장 애니메이션 재생 안 함(깜빡임 방지) */
@media (min-width:640px){
  .rv-modal__backdrop{ align-items:center; padding:20px; }
  .rv-modal{ border-radius:var(--radius-2xl); }
}

/* ---- 예약 확인 프리뷰 (붙여넣기 → 이렇게 등록할까요?) ---- */
.rv-confirm{ margin-top:14px; background:var(--brand-50); border:1px solid var(--brand-100);
  border-radius:var(--radius-lg); padding:14px; }
.rv-confirm__head{ display:flex; align-items:center; gap:8px; color:var(--brand-600);
  font-weight:700; font-size:var(--text-md); margin-bottom:8px; }
.rv-confirm__name{ font-size:var(--text-xl); font-weight:800; color:var(--ink-900); }
.rv-confirm__meta{ font-size:var(--text-md); color:var(--ink-700); margin-top:2px; }

/* ---- 처리 필요 알림 배너 (예약 탭 상단) ---- */
.rv-need{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; cursor:pointer;
  background:var(--warning-bg); border:1.5px solid var(--amber-100); border-radius:var(--radius-lg);
  padding:16px 18px; min-height:64px; font-family:var(--font-sans); }
.rv-need__ic{ width:40px; height:40px; flex:none; border-radius:999px; background:#fff; color:var(--amber-600);
  display:flex; align-items:center; justify-content:center; }
.rv-need__body{ flex:1; min-width:0; }
.rv-need__t{ display:block; font-size:var(--text-md); font-weight:800; color:var(--amber-700); }
.rv-need__s{ display:block; font-size:var(--text-sm); color:var(--amber-600); margin-top:1px; }
.rv-need__chev{ flex:none; color:var(--amber-600); display:flex; }

/* ---- 예약 등록 안내 라인 ---- */
.rv-hint-line{ text-align:center; font-size:var(--text-sm); color:var(--ink-600); margin-top:10px; font-weight:600; }

/* ---- 문자 내용 편집 (설정) : 좌 입력 | 우 미리보기 ---- */
.tpl-item{ padding:15px 0; border-top:1px solid var(--border-soft); }
.tpl-item:first-of-type{ padding-top:2px; border-top:none; }
/* 편집 펼침: 종류별로 회색 카드 블록 → 어디부터 어디까지인지 구분감 확실 */
.tpl-item--edit{ border-top:none; padding:16px; background:var(--surface-sunken); border:1px solid var(--border-soft); border-radius:16px; margin-bottom:14px; }
.tpl-item--edit:last-of-type{ margin-bottom:0; }
.tpl-item__head{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:nowrap; }
.tpl-item__label{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; }
.tpl-item__sw{ flex:none; }
.tpl-item__split, .tpl-item__off{ margin-top:14px; }
.tpl-item__title{ font-size:var(--text-lg); font-weight:800; color:var(--ink-900); }
.tpl-item__when{ font-size:var(--text-sm); font-weight:700; color:var(--brand-600); background:var(--brand-50); border-radius:999px; padding:3px 12px; white-space:nowrap; }
.tpl-item--off .tpl-item__title{ color:var(--ink-400); }
.tpl-item__off{ padding:14px 16px; background:var(--surface-sunken); border:1px solid var(--border-soft); border-radius:12px; font-size:var(--text-base); color:var(--ink-600); line-height:1.55; display:flex; align-items:center; gap:8px; }
.tpl-item__off b{ color:var(--amber-700); }
.tpl-item__split{ display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
.tpl-item__col{ min-width:0; }
.tpl-item__lbl{ display:flex; align-items:center; gap:6px; font-size:var(--text-base); font-weight:700; color:var(--ink-700); margin-bottom:9px; }
.tpl-ta{ min-height:132px; font-size:var(--text-base); line-height:1.65; }
@media (max-width:720px){ .tpl-item__split{ grid-template-columns:1fr; gap:20px; } }

/* 손님이 받는 모습: 카톡 배경 위 가게 채널명 + 흰 말풍선(한 컷) */
.tpl-pv{ display:flex; flex-direction:column; gap:16px; }
.pv-kakao{ background:#B2C7DA; border-radius:12px; padding:11px; max-width:290px; }
.pv-kakao__ch{ display:flex; align-items:center; gap:5px; font-size:var(--text-sm); font-weight:800; color:#3B2B20; margin-bottom:7px; }
.pv-kakao__bubble{ background:#fff; border-radius:4px 15px 15px 15px; padding:12px 15px; font-size:var(--text-base);
  line-height:1.6; color:var(--ink-900); white-space:pre-wrap; overflow-wrap:break-word; box-shadow:0 1px 2px rgba(17,24,39,.10); }
.pv-warn{ display:flex; align-items:flex-start; gap:7px; font-size:var(--text-sm); font-weight:600; line-height:1.55;
  color:var(--amber-700); background:var(--amber-50); border:1px solid var(--amber-100); border-radius:10px; padding:11px 13px; }

/* ---- 인라인 랭귀지 셀렉트 (고객 목록) ---- */
.rv-langsel{ font-family:var(--font-sans); font-size:var(--text-sm); font-weight:600;
  color:var(--ink-700); background:var(--surface); min-height:44px;
  border:1.5px solid var(--border-strong); border-radius:var(--radius-sm); padding:0 8px; cursor:pointer; }

/* ---- Calendar ---- */
.rv-cal__nav{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.rv-cal__arrow{ width:48px; height:48px; border-radius:12px; border:1.5px solid var(--border-strong);
  background:var(--surface); color:var(--ink-700); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.rv-cal__arrow:hover{ background:var(--surface-sunken); }
.rv-cal__arrow:disabled{ opacity:.4; cursor:default; }

/* details 토글을 버튼처럼 — 48px 탭 타겟(브리프), 접힌 폼의 발견성 개선 */
.rv-sumbtn{ display:flex; align-items:center; justify-content:center; gap:8px; min-height:48px;
  border:1.5px solid var(--border-soft); border-radius:var(--radius-md); background:var(--surface-sunken);
  font-size:var(--text-base); font-weight:700; color:var(--ink-700); cursor:pointer; list-style:none; user-select:none; }
.rv-sumbtn::-webkit-details-marker{ display:none; }
.rv-cal__month{ flex:1; font-size:var(--text-xl); font-weight:800; color:var(--ink-900);
  letter-spacing:var(--tracking-tight); min-width:128px; text-align:center; font-variant-numeric:tabular-nums; }
.rv-cal__toggle{ margin-left:auto; }
.rv-cal__wd, .rv-cal__grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
.rv-cal__wd{ margin-bottom:4px; }
.rv-cal__wdc{ text-align:center; font-size:var(--text-sm); font-weight:700; padding:2px 0; color:var(--ink-600); }
.rv-cal__wdc--sun{ color:var(--red-600); } .rv-cal__wdc--sat{ color:var(--brand-600); }
.rv-cal__day{ min-height:56px; border-radius:10px; cursor:pointer; border:1.5px solid transparent;
  background:transparent; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:6px 2px; }
.rv-cal__day:hover{ background:var(--surface-sunken); }
.rv-cal__day--has{ border-color:var(--brand-100); }
.rv-cal__day--today{ background:var(--brand-50); }
.rv-cal__daynum{ font-size:var(--text-base); font-weight:600; color:var(--ink-900); font-variant-numeric:tabular-nums; }
.rv-cal__daynum--sun{ color:var(--red-600); } .rv-cal__daynum--sat{ color:var(--brand-600); }
.rv-cal__day--today .rv-cal__daynum{ font-weight:800; color:var(--brand-700); }
.rv-cal__dots{ display:flex; gap:3px; height:6px; }
.rv-cal__dot{ width:6px; height:6px; border-radius:999px; }
.rv-cal__dot--b{ background:var(--brand-500); } .rv-cal__dot--s{ background:var(--rose-600); }
.rv-cal__hol{ font-size:10px; font-weight:700; line-height:1; color:var(--red-600);
  max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rv-cal__day--hol{ background:var(--red-50); }
.rv-cal__day--hol.rv-cal__day--today{ background:var(--brand-50); }
.rv-cal__foot{ font-size:var(--text-sm); color:var(--ink-600); text-align:center; margin-top:12px; }
.rv-daymodal__hol{ display:flex; align-items:center; gap:6px; margin-bottom:10px; padding:8px 12px;
  background:var(--red-50); border:1px solid var(--red-100); border-radius:var(--radius-md);
  color:var(--red-700); font-size:var(--text-sm); font-weight:700; }

/* ============================================================
   앱 셸 — 모바일 우선(폰 1열 + 하단 탭바), 900px+ 사이드 레일로 확장
   ============================================================ */
html, body { height: 100%; }
#root{ min-height:100vh; }   /* standalone엔 툴바가 없어 dvh 이점 0인데, PWA cold start에서 dvh만 오초기화됨 → vh */
.rv-root--app{ background:#e7e9ee; }
/* 아이폰 홈화면 앱에서 100dvh는 과소보고된 뷰포트(793pt)를, 100vh는 실제 화면(852pt)을 준다.
   dvh를 쓰면 탭바 아래 59pt가 비어 보였음 — standalone엔 툴바가 없어 dvh 이점도 없으므로 vh 고정. */
.rv-appwrap{ height:100vh; display:flex; flex-direction:column; background:#e7e9ee; }

.rv-demo{ width:100%; box-sizing:border-box; display:flex; align-items:center; justify-content:space-between;
  gap:8px; background:var(--ink-950); color:#cfd6e4; padding:7px 14px;
  padding-top:max(7px, env(safe-area-inset-top, 0px)); }   /* 데모바가 최상단일 때 노치 인셋 흡수(합산 대신 max — 두께 최소) */
.rv-demo__tag{ display:inline-flex; align-items:center; gap:6px; min-width:0; flex:1; font-size:13px; font-weight:700; color:#8b95a7;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rv-demo__btns{ display:flex; gap:6px; flex:none; }
.rv-demo button{ display:inline-flex; align-items:center; gap:5px; background:#252c3a; color:#e7ebf2;
  border:none; border-radius:8px; padding:8px 11px; font-size:12.5px; font-weight:700;
  font-family:var(--font-sans); cursor:pointer; white-space:nowrap; }
.rv-demo button:hover{ background:#2f3749; }

.rv-shell{ flex:1; min-height:0; }
.rv-rail{ display:none; }
.rv-app{ width:100%; height:100%; margin:0 auto; background:var(--bg); position:relative;
  display:flex; flex-direction:column; box-shadow:var(--shadow-lg); }
/* 플로팅 '의견' 버튼 — 모든 화면 우측 하단(탭바 위)에 상주. 모달(z 60) 아래라 모달 열면 가려짐. */
.rv-fab{ position:fixed; z-index:30; right:16px; bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  display:inline-flex; align-items:center; justify-content:center; width:60px; height:60px; padding:0; border:none; cursor:pointer;
  border-radius:999px; background:var(--brand-500); color:#fff; box-shadow:var(--shadow-lg);
  -webkit-tap-highlight-color:transparent; }
.rv-fab:hover{ background:var(--brand-600); }
.rv-fab:active{ transform:scale(0.95); }
/* 폰(≤600px)에선 화면을 꽉 채워 양쪽 여백 제거. 태블릿+에서만 폰형 컬럼(460px)으로 가운데 정렬. */
@media (min-width:600px){ .rv-app{ max-width:460px; } }
.rv-main{ flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain; position:relative; }   /* 끝에서 문서로 스크롤 체이닝 금지 — 아이폰 고무줄 바운스로 탭바 아래 여백 보이던 문제 */
/* 실수로 더블탭하면 화면이 확대돼 앱이 망가진 것처럼 보임 → 더블탭 확대만 차단.
   핀치(두 손가락) 확대는 그대로 = 잘 안 보이는 사장님의 접근성은 유지. 랜딩은 별도 파일이라 영향 없음. */
body{ touch-action:manipulation; }
/* 당겨서 새로고침 — 홈 화면 앱(standalone)엔 브라우저 새로고침 버튼이 없어서 직접 제공.
   자동 갱신(20초 폴링 + 앱 복귀 시 즉시)은 이미 돌지만, '지금 당장' 확인하고 싶을 때의 탈출구. */
.rv-ptr{ position:absolute; top:0; left:0; right:0; z-index:15; height:0; overflow:hidden;
  display:flex; align-items:center; justify-content:center; gap:7px; background:var(--bg);
  color:var(--ink-600); font-size:var(--text-sm); font-weight:700; white-space:nowrap;
  transition:height .18s ease; pointer-events:none; }
.rv-ptr--drag{ transition:none; }
.rv-ptr__spin{ width:16px; height:16px; border:2.5px solid var(--border-strong); border-top-color:var(--brand-500);
  border-radius:50%; animation:rvspin .7s linear infinite; }
@keyframes rvspin{ to{ transform:rotate(360deg); } }
/* 앱 뷰에선 문서 자체를 잠가(내부 #main만 스크롤) 사파리 하단바 접힘·바운스로 앱이 밀리지 않게 */
/* height:100% 는 과소보고된 뷰포트(793pt)로 잡혀 overflow:hidden이 852짜리 앱 컨테이너의
   아래 59pt를 잘라냈다 → 실제 화면과 같은 100vh 로 고정. */
html.rv-lock, html.rv-lock body{ height:100vh; overflow:hidden; overscroll-behavior:none; }
.rv-screen{ display:flex; flex-direction:column; gap:var(--gap-card); padding:16px 16px 96px; }
.rv-stats{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.rv-mark{ width:34px; height:34px; flex:none; display:block; }
@keyframes rvpulse{ 0%{ box-shadow:0 0 0 0 rgba(30,107,255,.4); } 100%{ box-shadow:0 0 0 12px rgba(30,107,255,0); } }

@media (min-width:900px){
  /* grid-template-rows:minmax(0,1fr) → 행이 콘텐츠가 아니라 셸 높이에 맞춰짐.
     이게 없으면 rv-main 대신 body가 스크롤돼 사이드바(레일)까지 같이 스크롤됨. */
  .rv-shell{ display:grid; grid-template-columns:272px minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
  .rv-rail{ display:flex; flex-direction:column; gap:4px; padding:22px 16px; min-height:0; overflow-y:auto;
    background:var(--surface); border-right:1px solid var(--border-default); }
  .rv-rail__brand{ display:flex; align-items:center; gap:12px; padding:8px 12px 18px; }
  .rv-rail__shop{ font-size:var(--text-lg); font-weight:800; color:var(--ink-900); letter-spacing:-.02em; }
  .rv-rail__type{ font-size:var(--text-sm); color:var(--ink-600); }
  .rv-app{ max-width:none; margin:0; box-shadow:none; }
  .rv-app .rv-appbar__lead{ display:none; }
  .rv-app .rv-bottomnav{ display:none; }
  .rv-screen{ max-width:880px; width:100%; margin:0 auto; padding:28px 32px 96px; }
  .rv-stats{ grid-template-columns:repeat(4,1fr); }
  .rv-fab{ bottom:24px; right:24px; }   /* 데스크톱: 하단 탭바 없음 */
}


/* ── 로그인·회원가입 화면 ──
   2026-07-20: landing.css를 죽은 코드로 보고 삭제했다가 이 규칙들이 같이 날아가
   /app 로그인 화면이 스타일 없이 뜨는 사고가 났다. lp- 클래스만 확인하고 au- 는
   확인 안 한 것이 원인. 여기로 옮겨 왔으니 다시 분리하지 말 것. */
.rv-root--auth { background:var(--bg); }
.au { min-height:100dvh; display:flex; flex-direction:column; align-items:center; padding:20px 16px 40px;
  padding-top:max(20px, calc(env(safe-area-inset-top, 0px) + 6px)); }
.au__in { width:100%; max-width:440px; }
.au__back { display:inline-flex; align-items:center; gap:6px; border:none; background:none; cursor:pointer;
  color:var(--ink-600); font-family:var(--font-sans); font-weight:700; font-size:var(--text-sm); padding:10px 4px; margin-bottom:8px; min-height:48px; }
.au__brand { display:flex; align-items:center; gap:12px; margin:8px 4px 22px; }
.au__mark { width:44px; height:44px; flex:none; display:block; }
.au__name { font-size:var(--text-xl); font-weight:800; letter-spacing:-.02em; word-break:keep-all; }
.au__desc { font-size:var(--text-sm); color:var(--ink-600); word-break:keep-all; }
.au__alt { text-align:center; margin-top:16px; }
.au__altbtn { border:none; background:none; cursor:pointer; color:var(--brand-600); font-family:var(--font-sans); font-weight:700; font-size:var(--text-base); padding:10px 8px; min-height:48px; }
.au__err { color:var(--red-600); font-size:var(--text-sm); font-weight:600; }
.au__err:empty { display:none; }
.au-hint { font-size:var(--text-sm); color:var(--ink-600); line-height:1.55; margin:8px 2px 0; }
.au-cert--pick { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; cursor:pointer;
  padding:22px 16px; border:2px dashed var(--border-strong); border-radius:14px; background:var(--surface-sunken);
  color:var(--brand-600); font-family:var(--font-sans); font-weight:800; font-size:var(--text-base); text-align:center; -webkit-tap-highlight-color:transparent; }
.au-cert--pick:hover { background:var(--surface); border-color:var(--brand-500); }
.au-cert--load { display:flex; align-items:center; gap:8px; padding:18px 16px; border-radius:14px; background:var(--surface-sunken); color:var(--ink-600); font-weight:700; font-size:var(--text-base); }
.au-cert--done { display:grid; gap:12px; padding:16px; border-radius:14px; background:var(--surface-sunken); border:1px solid var(--border-soft); }
.au-cert__ok { display:flex; align-items:center; gap:7px; color:var(--green-600); font-weight:800; font-size:var(--text-sm); line-height:1.5; }
.au-cert__redo { justify-self:start; display:inline-flex; align-items:center; gap:6px; border:none; background:none; cursor:pointer; color:var(--brand-600); font-family:var(--font-sans); font-weight:700; font-size:var(--text-sm); padding:4px 2px; min-height:48px; }

/* ── 위수탁 계약 확인 화면 (병원 전용, contract.js) ──
   법률 문장 벽 대신 요약 카드. 60대 원장님 기준으로 본문 15px 이상·행간 넉넉히. */
.rv-ct{ padding-bottom:32px; }
.rv-ct__head{ padding:4px 0 18px; }
.rv-ct__h1{ font-size:var(--text-xl); font-weight:800; color:var(--ink-900); line-height:1.35; word-break:keep-all; }
.rv-ct__lead{ margin-top:10px; font-size:var(--text-md); color:var(--ink-600); line-height:1.6; word-break:keep-all; }
.rv-ct__list{ display:grid; gap:2px; background:var(--surface); border:1px solid var(--border-soft); border-radius:16px; overflow:hidden; }
.rv-ct__item{ display:flex; gap:12px; align-items:flex-start; padding:16px 16px; background:var(--surface-card); }
.rv-ct__item + .rv-ct__item{ border-top:1px solid var(--border-soft); }
.rv-ct__ico{ flex:none; width:34px; height:34px; border-radius:10px; display:grid; place-items:center;
             background:var(--brand-50); color:var(--brand-600); }
.rv-ct__t{ font-size:var(--text-md); font-weight:800; color:var(--ink-900); word-break:keep-all; }
.rv-ct__b{ margin-top:3px; font-size:var(--text-sm); color:var(--ink-600); line-height:1.6; word-break:keep-all; }
.rv-ct__limits{ margin-top:14px; padding:16px; border-radius:14px; background:var(--amber-50, #FFFBEB); border:1px solid var(--amber-200, #FDE68A); }
.rv-ct__lt{ font-size:var(--text-md); font-weight:800; color:var(--ink-900); word-break:keep-all; }
.rv-ct__ls{ margin-top:4px; font-size:var(--text-sm); color:var(--ink-600); line-height:1.55; word-break:keep-all; }
.rv-ct__limits ul{ margin:12px 0 0; padding:0; list-style:none; display:grid; gap:12px; }
.rv-ct__limits li{ word-break:keep-all; }
.rv-ct__limits li b{ display:block; font-size:var(--text-sm); font-weight:800; color:var(--ink-900); line-height:1.45; }
.rv-ct__limits li span{ display:block; margin-top:3px; font-size:var(--text-sm); color:var(--ink-600); line-height:1.55; }
.rv-ct__full{ display:block; margin-top:14px; font-size:var(--text-sm); font-weight:700; color:var(--brand-600); text-decoration:none; }
.rv-ct__agree{ display:flex; gap:11px; align-items:flex-start; margin:18px 0 12px; cursor:pointer; word-break:keep-all; }
.rv-ct__agree input{ width:22px; height:22px; flex:none; margin-top:1px; accent-color:var(--brand-600); }
.rv-ct__agree span{ font-size:var(--text-md); font-weight:700; color:var(--ink-800); line-height:1.5; }
/* 계약 미동의 병원 — 탭바·예약등록 버튼 숨김(계약 전 환자 등록 차단). 서버도 같은 조건으로 막는다. */
html.rv-contract .rv-fab,
html.rv-contract #rv-bottomnav,
html.rv-contract #rv-railnav{ display:none !important; }

/* ── 등록 확인 카드 정비(2026-07-21, 실사용 픽셀 지적) — 행 7개가 같은 톤으로 쌓여 위계가 없었고
   아이콘 3종(14/15/20)·인라인 스타일 누더기·'·'가 줄 머리에 매달리는 줄바꿈까지. 60대 브리프 기준 재정렬:
   이름(제일 큼) → 일시(주요 정보, 진하게) → 보조 행(아이콘 16 통일·같은 행간) → 경고는 박스로 분리. */
.rv-nb{ white-space:nowrap; }
.rv-confirm__when{ margin-top:8px; font-size:var(--text-lg); font-weight:800; color:var(--ink-900); word-break:keep-all; line-height:1.4; }
.rv-confirm__warn{ display:flex; gap:9px; align-items:flex-start; margin-top:10px; padding:11px 13px;
  background:var(--amber-50); border:1px solid var(--amber-100); border-radius:12px;
  color:var(--amber-700); font-size:var(--text-sm); font-weight:700; line-height:1.5; word-break:keep-all; }
.rv-confirm__warn svg{ flex:none; margin-top:2px; }
.rv-confirm__rows{ display:grid; gap:8px; margin-top:12px; }
.rv-confirm__row{ display:flex; gap:9px; align-items:flex-start; font-size:var(--text-md);
  color:var(--ink-700); line-height:1.45; word-break:keep-all; }
.rv-confirm__row svg{ flex:none; margin-top:3px; color:var(--ink-500); }
.rv-confirm__row--ok{ color:var(--brand-600); font-weight:700; }
.rv-confirm__row--ok svg{ color:var(--brand-600); }
.rv-confirm__chip{ white-space:nowrap; align-self:center; font-size:var(--text-xs); font-weight:800;
  color:var(--brand-600); background:#fff; border:1px solid var(--brand-100); padding:2px 9px; border-radius:99px; }
