/* stay 共通の部品（アプリ担当）
   決まり: KB shared/stay-デザインの決まり.md（2026-12-04 Ooe 承認）。数値は見本の4画面に合わせた
   使う側: PWA（apps/app）・玄関（apps/guest）・客室タブレット（apps/tablet）。公開するときは写しを中に入れる（README）
   クラスは s- で始まる。色・文字・大きさを各担当で決めない。足りない部品はアプリ担当へ */

@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500&family=Noto+Sans+JP:wght@400;500;700&display=swap");

/* ---------- 2. 色（これ以外を使わない） ---------- */
:root {
  --stay-ground: #F2F3F1;
  --stay-surface: #FFFFFF;
  --stay-ink: #14181A;
  --stay-ink-soft: #4A5357;
  --stay-accent: #1D4B53;
  --stay-accent-deep: #12333A;
  --stay-accent-tint: #E3ECEC;
  --stay-alert: #8C2F21;
  --stay-alert-tint: #F6E4E0;
  --stay-alert-on-tint: #6E2419;
  --stay-line: #D5D8D6;
  --stay-line-soft: #E4E6E4;
  --stay-line-strong: #9AA3A5;
  --stay-brass: #8A6A2F;
  --stay-brass-on-dark: #E0C48A;
  --stay-placeholder: #6B7478;   /* 入力欄の例の文字だけ（見本どおり） */

  /* 3. 文字 */
  --stay-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --stay-sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;

  /* 4. 形と余白 */
  --stay-radius-card: 10px;
  --stay-radius-control: 8px;
  --stay-radius-bubble: 18px;
  --stay-pad-guest: 28px;
  --stay-pad-app: 16px;
  --stay-tabbar: 72px;

  color-scheme: light;
}

/* ---------- 土台 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--stay-ground);
  color: var(--stay-ink);
  font-family: var(--stay-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--stay-accent); }
a:hover { color: var(--stay-accent-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--stay-accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* 画面の左右の余白 */
.s-page { padding-inline: var(--stay-pad-app); }
.s-page--guest { padding-inline: var(--stay-pad-guest); }

/* ---------- 文字の型 ---------- */
.s-title {             /* 画面の見出し（明朝 30px） */
  margin: 0;
  font-family: var(--stay-serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-wrap: balance;
}
.s-unit-name {         /* 棟の名前（明朝 21〜24px） */
  font-family: var(--stay-serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}
.s-unit-name--lg { font-size: 24px; }
.s-unit-name--sm { font-size: 21px; }
.s-eyebrow {           /* 見出しの上の小さなラベル（例「今日の仕事」） */
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--stay-ink-soft);
}
.s-mark {              /* TUULI YUFU */
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--stay-ink-soft);
  text-transform: uppercase;
}
.s-brass-line { width: 32px; height: 1px; background: var(--stay-brass); border: 0; margin: 0; }
.s-body { font-size: 17px; line-height: 1.7; }
.s-note { font-size: 14px; line-height: 1.7; color: var(--stay-ink-soft); }   /* 補足（13〜14px） */
.s-small { font-size: 13px; line-height: 1.7; color: var(--stay-ink-soft); }  /* 13px より小さくしない */
.s-number { font-size: 30px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.s-number--strong { font-size: 22px; font-weight: 700; }
.s-section-label {     /* 「今日のお客様」など一覧の見出し */
  margin: 24px 4px 10px;
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--stay-ink-soft);
}

/* ---------- 5. ボタン ---------- */
.s-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px;
  border-radius: var(--stay-radius-control);
  border: 1px solid var(--stay-line-strong);
  background: var(--stay-surface);
  color: var(--stay-ink);
  font-size: 16px; font-weight: 500; line-height: 1.3;
  text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.s-btn:hover { color: var(--stay-ink); border-color: var(--stay-ink-soft); }
.s-btn:disabled, .s-btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.s-btn > svg { flex: none; }
.s-btn--primary {                       /* 主ボタン: 60px・差し色・字間 0.1em */
  min-height: 60px;
  border-color: var(--stay-accent);
  background: var(--stay-accent);
  color: #FFFFFF;
  font-size: 18px;
  letter-spacing: 0.1em;
}
.s-btn--primary:hover { color: #FFFFFF; background: var(--stay-accent-deep); border-color: var(--stay-accent-deep); }
.s-btn--alert { border-color: var(--stay-alert); color: var(--stay-alert); }   /* 注意のボタン（「問題あり」） */
.s-btn--alert:hover { color: var(--stay-alert); border-color: var(--stay-alert); background: var(--stay-alert-tint); }
.s-btn--block { display: flex; width: 100%; }
.s-btn--quiet {                         /* 枠の無い文字だけのボタン（「あとで」など） */
  min-height: 44px; border-color: transparent; background: transparent; color: var(--stay-ink-soft); padding: 0 12px;
}
.s-btn--quiet:hover { border-color: transparent; color: var(--stay-ink); }
.s-btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.s-stack { display: flex; flex-direction: column; gap: 10px; }

/* 丸いアイコンボタン（44〜52px の円。aria-label 必須） */
.s-icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex: none;
  border: 1px solid var(--stay-line-strong); border-radius: 50%;
  background: var(--stay-surface); color: var(--stay-ink);
  cursor: pointer; padding: 0;
}
.s-icon-btn--sm { width: 44px; height: 44px; }
.s-icon-btn--lg { width: 52px; height: 52px; }
.s-icon-btn--accent { border-color: var(--stay-accent); background: var(--stay-accent); color: #FFFFFF; }  /* 送信 */
.s-icon-btn--plain { border-color: transparent; background: transparent; }                                 /* 戻る */
.s-badge {             /* 通知の数 */
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--stay-alert); color: #FFFFFF;
  font-size: 13px; font-weight: 700; line-height: 22px; text-align: center;
}

/* ピルの小さなボタン（言語を選ぶ など） */
.s-pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--stay-line-strong); border-radius: 22px;
  background: transparent; color: var(--stay-ink);
  font-size: 14px; cursor: pointer;
}

/* ---------- 入力欄（ラベルは必ず上） ---------- */
.s-field { display: flex; flex-direction: column; gap: 10px; }
.s-field > label, .s-label { font-size: 17px; line-height: 1.7; color: var(--stay-ink); }
.s-input, .s-select, .s-textarea {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--stay-line-strong);
  border-radius: 6px;
  background: var(--stay-surface);
  color: var(--stay-ink);
  font-size: 18px;
}
.s-input--lg { min-height: 60px; font-size: 20px; }
.s-select--compact {   /* 頭の帯に置く小さな選択（施設を選ぶ など） */
  width: auto; min-height: 44px; padding: 0 36px 0 14px;
  border-radius: 22px; font-size: 15px;
  appearance: none; -webkit-appearance: none;
  background: var(--stay-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A5357' stroke-width='1.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.s-textarea { min-height: 120px; padding: 14px 18px; line-height: 1.7; resize: vertical; }
.s-input::placeholder, .s-textarea::placeholder { color: var(--stay-placeholder); }
.s-input:focus, .s-select:focus, .s-textarea:focus { outline: 2px solid var(--stay-accent); outline-offset: 0; border-color: var(--stay-accent); }
.s-field-hint { font-size: 14px; line-height: 1.7; color: var(--stay-ink-soft); }
.s-field-error { font-size: 14px; line-height: 1.7; color: var(--stay-alert); }
.s-code-input {        /* 招待コード・鍵番号のように1文字ずつ読むもの */
  font-size: 26px; letter-spacing: 0.18em; text-align: center; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ---------- カード ---------- */
.s-card {
  background: var(--stay-surface);
  border: 1px solid var(--stay-line);
  border-radius: var(--stay-radius-card);
  padding: 20px;
}
.s-card + .s-card { margin-top: 16px; }
.s-card--flush { padding: 0; }
.s-card__row { padding: 18px; }
.s-card__row + .s-card__row { border-top: 1px solid var(--stay-line-soft); }
.s-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 8px; }
.s-card__title { font-size: 17px; font-weight: 700; letter-spacing: 0.06em; }
.s-card--alert { border-color: var(--stay-alert); }
.s-card--accent { border-color: var(--stay-accent); }
.s-divider { height: 1px; background: var(--stay-line); border: 0; margin: 0; }

/* アイコンの丸い台 + 棟の名前（カードの頭） */
.s-lead { display: flex; align-items: center; gap: 12px; }
.s-icon-disc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: var(--stay-accent-tint); color: var(--stay-accent);
}

/* ---------- 印（チップ） ---------- */
.s-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.s-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 4px 12px; border-radius: 16px;
  font-size: 14px; font-weight: 500; line-height: 1.3;
  background: var(--stay-accent-tint); color: var(--stay-accent-deep);
}
.s-chip--todo { background: var(--stay-alert-tint); color: var(--stay-alert-on-tint); }
.s-chip--plain { background: var(--stay-ground); color: var(--stay-ink-soft); }

/* ---------- 数字のタイル ---------- */
.s-tiles { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; }
.s-tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px; border-radius: var(--stay-radius-control);
  background: var(--stay-ground);
  min-width: 0;
}
.s-tile--card { background: var(--stay-surface); border: 1px solid var(--stay-line); border-radius: var(--stay-radius-card); padding: 16px 12px; }
.s-tile__label { font-size: 13px; line-height: 1.5; color: var(--stay-ink-soft); overflow-wrap: anywhere; }
.s-tile__value { font-size: 30px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.s-tile--card .s-tile__value { font-size: 32px; }
.s-tile--alert { border-color: var(--stay-alert); }
.s-tile--alert .s-tile__label { color: var(--stay-alert); font-weight: 700; }
.s-tile--alert .s-tile__value { color: var(--stay-alert); }

/* 「次のお客様」のような強調の箱 */
.s-callout {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; border: 1px solid var(--stay-accent); border-radius: var(--stay-radius-control);
  color: var(--stay-ink);
}
.s-callout > svg { color: var(--stay-accent); flex: none; }

/* ---------- 日・週・月の切替 ---------- */
.s-segmented { display: inline-flex; border: 1px solid var(--stay-line-strong); border-radius: 22px; overflow: hidden; background: var(--stay-surface); }
.s-segmented > button {
  min-width: 44px; height: 44px; padding: 0 10px;
  border: 0; background: transparent; color: var(--stay-ink);
  font-size: 15px; cursor: pointer;
}
.s-segmented > button[aria-pressed="true"] { background: var(--stay-ink); color: #FFFFFF; }

/* ---------- 上の帯（画面の頭） ---------- */
.s-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 24px) 20px 16px;
}
.s-header__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.s-header .s-title { white-space: nowrap; }   /* 日付は折り返さない。入らなければ右の部品が次の行へ回る */
.s-bar {               /* チャットなどの白い頭 */
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--stay-surface); border-bottom: 1px solid var(--stay-line);
}

/* ---------- 下のタブ ---------- */
.s-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr));
  padding: 8px 0 calc(env(safe-area-inset-bottom) + 10px);
  background: var(--stay-surface); border-top: 1px solid var(--stay-line);
}
.s-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 56px; padding: 0 2px;
  color: var(--stay-ink-soft); text-decoration: none;
  font-size: 12px; line-height: 1.3; text-align: center;
  overflow-wrap: anywhere;
}
.s-tab:hover { color: var(--stay-ink); }
.s-tab[aria-current="page"] { color: var(--stay-accent); font-weight: 700; }
.s-tab[aria-disabled="true"] { color: var(--stay-line-strong); pointer-events: none; }
.s-with-tabbar { padding-bottom: calc(var(--stay-tabbar) + env(safe-area-inset-bottom) + 24px); }

/* PC では左に縦のタブ。中身の幅は広げすぎない */
@media (min-width: 900px) {
  .s-tabbar {
    top: 0; right: auto; width: 104px;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 88px 0 0; border-top: 0; border-right: 1px solid var(--stay-line);
  }
  .s-tab { min-height: 72px; font-size: 13px; }
  .s-with-tabbar { padding-bottom: 40px; }
  .s-has-tabbar { padding-left: 104px; }   /* 下のタブを使う画面のいちばん外に付ける。PC では縦タブのぶん右へ */
}
.s-container { width: 100%; max-width: 720px; margin-inline: auto; }

/* ---------- 強い通知の帯 ---------- */
.s-alert-band {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--stay-radius-card);
  background: var(--stay-ink); color: #FFFFFF; text-decoration: none;
}
.s-alert-band:hover { color: #FFFFFF; }
.s-alert-band > svg:first-child { color: var(--stay-brass-on-dark); flex: none; }
.s-alert-band__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.s-alert-band__title { font-size: 17px; font-weight: 700; line-height: 1.5; }
.s-alert-band__sub { font-size: 14px; color: var(--stay-line); }

/* 弱い案内（ホーム画面に追加・通知を許可など）。強い帯ほど目立たせない */
.s-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--stay-radius-card);
  background: var(--stay-surface); border: 1px solid var(--stay-line);
}
.s-notice > svg:first-child { color: var(--stay-accent); flex: none; }
.s-notice__text { flex: 1 1 200px; min-width: 0; }
.s-notice__actions { display: flex; gap: 8px; margin-left: auto; }   /* 入らなければ文の下へ回る */
.s-notice .s-btn { min-height: 44px; font-size: 15px; letter-spacing: 0.04em; padding: 0 16px; }
.s-notice__title { font-size: 16px; font-weight: 700; line-height: 1.5; }
.s-notice__sub { font-size: 14px; line-height: 1.6; color: var(--stay-ink-soft); }

/* ---------- 吹き出し（チャット: 18px・行の高さ 1.75） ---------- */
.s-thread { display: flex; flex-direction: column; gap: 22px; padding: 24px 20px; }
.s-day { align-self: center; font-size: 13px; letter-spacing: 0.12em; color: var(--stay-ink-soft); }
.s-msg { display: flex; flex-direction: column; gap: 6px; max-width: min(300px, 82%); align-self: flex-start; }
.s-msg--mine { align-self: flex-end; align-items: flex-end; }
.s-bubble {
  padding: 16px 18px;
  background: var(--stay-surface); border: 1px solid var(--stay-line);
  border-radius: 4px var(--stay-radius-bubble) var(--stay-radius-bubble) var(--stay-radius-bubble);
  font-size: 18px; line-height: 1.75;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.s-msg--mine .s-bubble {
  background: var(--stay-accent); border-color: var(--stay-accent); color: #FFFFFF;
  border-radius: var(--stay-radius-bubble) 4px var(--stay-radius-bubble) var(--stay-radius-bubble);
}
.s-bubble__original { border-top: 1px solid var(--stay-line); margin-top: 12px; padding-top: 12px; }
.s-bubble__original > summary {
  display: flex; align-items: center; gap: 8px; min-height: 32px;
  font-size: 14px; color: var(--stay-ink-soft); cursor: pointer; list-style: none;
}
.s-bubble__original > summary::-webkit-details-marker { display: none; }
.s-bubble__original > div { margin-top: 8px; font-size: 15px; line-height: 1.7; color: var(--stay-ink-soft); }
.s-msg__meta { font-size: 13px; color: var(--stay-ink-soft); }
.s-msg--system { align-self: center; max-width: 100%; }
.s-msg--system .s-bubble { background: var(--stay-ground); border-style: dashed; border-radius: var(--stay-radius-card); font-size: 16px; }
.s-composer {          /* 写真・入力・送信の3つだけ */
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 16px);
  background: var(--stay-surface); border-top: 1px solid var(--stay-line);
}
.s-composer .s-input { flex: 1; min-width: 0; min-height: 52px; border-radius: 26px; background: var(--stay-ground); }

/* ---------- チェックの行 ---------- */
.s-checks { display: flex; flex-direction: column; }
.s-check {
  display: flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 6px 0;
  border-top: 1px solid var(--stay-line-soft);
  font-size: 18px; line-height: 1.5;
  cursor: pointer;
}
.s-check > input[type="checkbox"] {
  width: 26px; height: 26px; margin: 0; flex: none;
  accent-color: var(--stay-accent);
}
.s-check__label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.s-check__count { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.s-check--off { color: var(--stay-ink-soft); }   /* 「使わない」にした項目を見せるとき */

/* ---------- 進みぐあい（玄関） ---------- */
.s-steps { display: grid; grid-template-columns: repeat(var(--steps, 3), minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.s-step { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--stay-ink-soft); font-size: 13px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.s-step[aria-current="step"] { color: var(--stay-accent); font-weight: 700; }

/* ---------- 鍵番号（いちばん大きく） ---------- */
.s-keycode {
  font-family: var(--stay-sans); font-weight: 700;
  font-size: clamp(48px, 16vw, 64px); line-height: 1.1;
  letter-spacing: 0.18em; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- 一覧の行（設定など） ---------- */
.s-list { display: flex; flex-direction: column; }
.s-list__item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 0; border-top: 1px solid var(--stay-line-soft); }
.s-list__item:first-child { border-top: 0; }
.s-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* ---------- お知らせ（画面の下に短く出る） ---------- */
.s-toast {
  position: fixed; left: 50%; bottom: calc(var(--stay-tabbar) + env(safe-area-inset-bottom) + 16px); z-index: 50;
  transform: translate(-50%, 12px); opacity: 0; transition: opacity .2s, transform .2s;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--stay-radius-control);
  background: var(--stay-ink); color: #FFFFFF; font-size: 15px; line-height: 1.5;
}
.s-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.s-toast--alert { background: var(--stay-alert); }

/* ---------- 下から出る確認（confirm の代わり） ---------- */
.s-sheet {
  border: 0; padding: 24px 20px calc(env(safe-area-inset-bottom) + 20px);
  width: min(480px, 100vw); max-width: 100vw; margin: auto auto 0;
  border-radius: 16px 16px 0 0;
  background: var(--stay-surface); color: var(--stay-ink);
}
.s-sheet::backdrop { background: rgba(20, 24, 26, .5); }
@media (min-width: 600px) { .s-sheet { margin: auto; border-radius: 16px; } }
.s-sheet__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.5; }

/* ---------- 真ん中に1つだけ置く画面（ログイン・招待・止められた端末） ---------- */
.s-center {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  padding: calc(env(safe-area-inset-top) + 28px) var(--stay-pad-guest) calc(env(safe-area-inset-bottom) + 28px);
  width: 100%; max-width: 480px; margin-inline: auto;
}

/* 目に見えないが読み上げられる文字 */
.s-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .s-toast { transition: none; }
}
