/* ============================================================
   湯治日記 — デザインシステム v0.3 (Phase 0 モック)
   和紙クリーム基調 ＋ 抹茶緑アクセント / 競争指標を出さない
   ============================================================ */

:root {
  /* --- 地色（和紙・クリーム） --- */
  --washi:        #FAF7F0;  /* 画面の地 */
  --washi-2:      #F4EFE3;  /* 一段沈んだ面 */
  --card:         #FFFDF8;  /* カード面 */
  --line:         #E7DFCE;  /* 罫・境界 */
  --line-soft:    #F0E9DA;

  /* --- 墨（文字） --- */
  --ink:          #3B362E;  /* 主文字 */
  --ink-2:        #6E675A;  /* 副文字 */
  --ink-3:        #9A9284;  /* 補助・プレースホルダ */

  /* --- 抹茶緑（アクセント） --- */
  --matcha:       #7C8C5A;
  --matcha-deep:  #5E6E42;
  --matcha-soft:  #EDF0E2;
  --matcha-line:  #D6DDC2;

  /* --- 差し色（最小限・湯けむり／灯り） --- */
  --yuake:        #C98F63;  /* 湯あかり（記録の日数などに極少量） */
  --yuake-soft:   #F6EADF;

  /* --- 質感 --- */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 22px;
  --r-pill: 999px;
  --shadow-s: 0 1px 2px rgba(59,54,46,.04);
  --shadow-m: 0 2px 10px rgba(59,54,46,.06);
  --shadow-l: 0 8px 28px rgba(59,54,46,.10);

  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Noto Sans JP", "Yu Gothic Medium", sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;

  --nav-h: 62px;
  --app-h: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--washi);
  line-height: 1.75;
  font-size: 15px;
  letter-spacing: .01em;
}

/* 和紙のかすかな地紋 */
.washi-grain {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.012) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 65%, rgba(0,0,0,.010) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
}

/* ------------------------------------------------------------
   タイポグラフィ
   ------------------------------------------------------------ */
.t-logo   { font-family: var(--font-serif); font-weight: 600; letter-spacing: .12em; }
.t-title  { font-family: var(--font-serif); font-size: 19px; font-weight: 600; letter-spacing: .06em; margin: 0; }
.t-sect   { font-family: var(--font-serif); font-size: 15px; font-weight: 600; letter-spacing: .08em; color: var(--ink); margin: 0; }
.t-body   { font-size: 14.5px; color: var(--ink); }
.t-sub    { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.t-mini   { font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }

/* ------------------------------------------------------------
   画面の骨組み
     モックの .phone（端末フレーム）は実画面には無い。
     幅は 480px で頭打ちにして、広い画面では中央に置く。
   ------------------------------------------------------------ */
html, body { min-height: 100%; }

body.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--washi);
}
body.app-with-nav { padding-bottom: var(--nav-h); }

.screen {
  flex: 1;
  overscroll-behavior: contain;
}

/* スクリーンリーダー用（ラベルは残しつつ画面には出さない） */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------
   アプリバー
   ------------------------------------------------------------ */
.appbar {
  height: var(--app-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(250,247,240,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 5;
}
.appbar-slot { width: 32px; height: 32px; }
.appbar .t-logo { font-size: 16px; color: var(--matcha-deep); }
.appbar-icon {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: var(--ink-2);
  background: transparent; border: 0; cursor: pointer;
}
.appbar-icon:hover { background: var(--washi-2); }

/* ------------------------------------------------------------
   タブ（おすすめ / フォロー中 / 新着）
   ------------------------------------------------------------ */
.tabs {
  display: flex; gap: 4px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--washi);
}
.tab {
  flex: 1; text-align: center;
  padding: 7px 0 8px;
  font-size: 13px; color: var(--ink-3);
  background: transparent; border: 0; cursor: pointer;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  transition: color .15s, background .15s;
}
.tab[aria-selected="true"] {
  color: var(--matcha-deep);
  background: var(--matcha-soft);
  font-weight: 600;
}

/* ------------------------------------------------------------
   カード / 投稿
   ------------------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.list { display: flex; flex-direction: column; gap: 14px; padding: 14px; }

.post-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--matcha-soft); border: 1px solid var(--matcha-line);
  display: grid; place-items: center;
  font-size: 14px; color: var(--matcha-deep);
  font-family: var(--font-serif);
  flex: 0 0 auto;
}
.post-who { min-width: 0; }
.post-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.post-meta { font-size: 11.5px; color: var(--ink-3); letter-spacing: .03em; }

/* 滞在日数：唯一許された数字 */
.daybadge {
  margin-left: auto; flex: 0 0 auto;
  font-family: var(--font-serif);
  font-size: 12px; color: var(--matcha-deep);
  background: var(--matcha-soft);
  border: 1px solid var(--matcha-line);
  border-radius: var(--r-pill);
  padding: 3px 11px;
  letter-spacing: .06em;
  white-space: nowrap;
}

.post-caption { padding: 0 15px 12px; font-size: 14px; color: var(--ink); }
.post-foot { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; }

/* ------------------------------------------------------------
   写真プレースホルダ（湯けむり・部屋・風景）
   ------------------------------------------------------------ */
.photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: var(--washi-2);
}
.photo::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 60% at 50% 100%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(80% 40% at 20% 15%, rgba(255,255,255,.30), transparent 70%);
  pointer-events: none;
}
.photo.tall { aspect-ratio: 1 / 1; }
/* 湯けむり */
.ph-1 { background: linear-gradient(170deg,#CBD2C3 0%,#AEB9A6 45%,#8E9C86 100%); }
/* 夕暮れの露天 */
.ph-2 { background: linear-gradient(165deg,#E7C9A4 0%,#C99A73 55%,#8E7358 100%); }
/* 障子と朝の光 */
.ph-3 { background: linear-gradient(155deg,#FBF4E6 0%,#EFE2C9 50%,#D8C7A6 100%); }
/* 雪の宿 */
.ph-4 { background: linear-gradient(170deg,#EDF1F2 0%,#D2DBDD 55%,#A9B7BA 100%); }
/* 山の緑 */
.ph-5 { background: linear-gradient(160deg,#D3DDBE 0%,#A3B584 50%,#6E7F55 100%); }
/* 夜の湯宿 */
.ph-6 { background: linear-gradient(170deg,#5D5C5A 0%,#3F423F 60%,#2C2E2B 100%); }

/* 写真の上の小さな注記（○日目など） */
.photo-note {
  position: absolute; left: 12px; bottom: 11px; z-index: 2;
  font-family: var(--font-serif); font-size: 11.5px; letter-spacing: .08em;
  color: #fff; background: rgba(45,42,36,.34);
  backdrop-filter: blur(4px);
  padding: 3px 10px; border-radius: var(--r-pill);
}

/* ------------------------------------------------------------
   なでなで（数は絶対に出さない）
   ------------------------------------------------------------ */
.nade {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--washi-2);
  color: var(--ink-2);
  font-size: 12.5px; font-family: var(--font-sans);
  cursor: pointer;
  transition: all .18s ease;
}
.nade:hover { border-color: var(--matcha-line); color: var(--matcha-deep); }
.nade[aria-pressed="true"] {
  background: var(--matcha-soft);
  border-color: var(--matcha-line);
  color: var(--matcha-deep);
}
.nade svg { width: 15px; height: 15px; }
/* なでなで済みの気配だけ（人数は出さない） */
.nade-hint { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; }

/* ------------------------------------------------------------
   ボタン
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px; font-family: var(--font-sans);
  cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.btn:hover { background: var(--washi-2); }
.btn-primary {
  background: var(--matcha-deep); border-color: var(--matcha-deep); color: #fff;
  font-weight: 600; letter-spacing: .06em;
  box-shadow: 0 2px 8px rgba(94,110,66,.22);
}
.btn-primary:hover { background: #55663B; }
.btn-ghost { background: transparent; border-color: var(--matcha-line); color: var(--matcha-deep); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 22px; font-size: 15px; }

/* ------------------------------------------------------------
   チップ（目的・タグ）
   ------------------------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px; cursor: pointer;
  font-family: var(--font-sans);
  transition: all .15s;
}
.chip:hover { border-color: var(--matcha-line); }
.chip[aria-pressed="true"], .chip.is-on {
  background: var(--matcha-soft); border-color: var(--matcha-line);
  color: var(--matcha-deep); font-weight: 600;
}
.chip-sm { padding: 4px 10px; font-size: 11.5px; }

/* ------------------------------------------------------------
   フォーム
   ------------------------------------------------------------ */
.field { margin-bottom: 20px; }
.label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 8px; letter-spacing: .06em; font-weight: 600;
}
.label .opt { color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.input, .textarea, .select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px; font-family: var(--font-sans);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--matcha-line);
  box-shadow: 0 0 0 3px var(--matcha-soft);
}
.textarea { min-height: 104px; resize: none; line-height: 1.8; }
.help { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; line-height: 1.7; }

/* 公開範囲のセグメント */
.segment {
  display: flex; gap: 6px; padding: 5px;
  background: var(--washi-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
}
.segment button {
  flex: 1; padding: 9px 4px; border: 0; background: transparent;
  border-radius: var(--r-pill); cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); font-family: var(--font-sans);
  transition: all .15s;
}
.segment button[aria-pressed="true"] {
  background: var(--card); color: var(--matcha-deep); font-weight: 600;
  box-shadow: var(--shadow-s);
}

/* ------------------------------------------------------------
   空状態（やさしく短く）
   ------------------------------------------------------------ */
.empty {
  text-align: center;
  padding: 46px 30px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.empty-art {
  width: 74px; height: 74px; border-radius: var(--r-pill);
  background: var(--matcha-soft); border: 1px solid var(--matcha-line);
  display: grid; place-items: center; color: var(--matcha);
}
.empty-title { font-family: var(--font-serif); font-size: 15.5px; letter-spacing: .06em; }
.empty-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }

/* ------------------------------------------------------------
   ボトムナビ
   ------------------------------------------------------------ */
.bottomnav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  display: flex; align-items: stretch;
  background: rgba(250,247,240,.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  z-index: 10;
}
.navitem {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 10.5px; letter-spacing: .04em;
  font-family: var(--font-sans);
  transition: color .15s;
  text-decoration: none;
}
.navitem svg { width: 21px; height: 21px; }
.navitem[aria-selected="true"] { color: var(--matcha-deep); font-weight: 600; }

/* 記録するFAB */
.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px);
  z-index: 9;
  height: 48px; padding: 0 20px;
  border-radius: var(--r-pill);
  background: var(--matcha-deep); color: #fff; border: 0;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .08em;
  font-family: var(--font-sans);
  box-shadow: 0 6px 18px rgba(94,110,66,.30);
  cursor: pointer;
}

/* ------------------------------------------------------------
   区切り・小物
   ------------------------------------------------------------ */
.sect-head { display: flex; align-items: baseline; gap: 10px; padding: 18px 16px 8px; }
.divider { height: 1px; background: var(--line-soft); margin: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px; }
.grid3 .photo { aspect-ratio: 1/1; border-radius: 3px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.pad { padding: 16px; }

/* ------------------------------------------------------------
   認証画面
     モック（mock/screens/auth.html）の <style> と、そこで
     style="" で書かれていた分をクラスに起こしたもの。
     インラインの style 属性は CSP（style-src 'self'）で使えない。
   ------------------------------------------------------------ */
.auth-screen {
  min-height: calc(100vh - 32px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 30px; background: var(--washi);
}
.auth-center {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 320px;
}
.auth-center-stretch { align-items: stretch; }
.auth-logo { font-size: 24px; color: var(--matcha-deep); margin: 0; }
.auth-rule {
  width: 38px; height: 2px; margin-top: 10px;
  background: var(--matcha-line); border-radius: 2px;
}

.auth-lead { text-align: center; margin: 16px 0 30px; }
.auth-form { width: 100%; }
.auth-form-inline { margin: 0; }
.auth-field { width: 100%; margin-bottom: 20px; }
.auth-sent-title { margin-top: 16px; }
.auth-sent-text { text-align: center; margin: 10px 0 28px; }
.auth-welcome-title { text-align: center; margin: 0 0 6px; }
.auth-welcome-sub { text-align: center; margin: 0 0 28px; }
.field-tight { margin-bottom: 8px; }
.help-center { text-align: center; }
.help-loose { margin: 0 0 22px; }

/* 入力の差し戻し。赤で咎めず、湯あかりの色で静かに示す。 */
.form-error {
  font-size: 12.5px; line-height: 1.7;
  color: #8A5A34;
  background: var(--yuake-soft);
  border: 1px solid #E8D3BE;
  border-radius: var(--r-m);
  padding: 10px 13px;
  margin: 0 0 16px;
}

/* 小物 */
.pad-center { text-align: center; }
.t-sub-gap { margin: 6px 0 16px; }

/* 静けさのための「数字を出さない」ルールの覚書:
   - フォロワー数 / なでなで数 / ランキング / 制覇数 は DOM に一切書かない
   - 表示してよい数字は「滞在○日目」と、自分のマイページの記録件数のみ */

/* ------------------------------------------------------------
   うちの宿 / 記録
     モック（mock/screens/inn.html・compose.html）の <style> と、
     そこで style="" で書かれていた分をクラスに起こしたもの。
     インラインの style 属性は CSP（style-src 'self'）で使えない。
   ------------------------------------------------------------ */

/* 「この宿の記録を見る」の控えめなリンク行 */
.inn-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 16px;
  margin-top: 3px;
  border-top: 1px solid var(--line-soft);
  color: var(--matcha-deep);
  font-size: 12.5px;
  letter-spacing: .04em;
  text-decoration: none;
}
.inn-more:hover { background: var(--washi-2); }

.chips-gap { margin-top: 12px; }
.note-gap   { margin: 12px 0 0; }
.form-lead  { margin: 0 0 20px; }
.daybadge-plain { margin-left: 0; }
.row-grow { flex: 1; min-width: 0; }

/* 宿カードの下に並ぶ操作（JSなしで動くよう素の form にする） */
.inn-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
.inn-actions form { margin: 0; flex: 1 1 auto; }
.inn-edit { border-top: 1px solid var(--line-soft); }
.inn-edit > summary {
  list-style: none; cursor: pointer;
  padding: 13px 16px;
  color: var(--matcha-deep); font-size: 12.5px; letter-spacing: .04em;
}
.inn-edit > summary::-webkit-details-marker { display: none; }
.inn-edit > summary:hover { background: var(--washi-2); }
.inn-edit-body { padding: 4px 16px 16px; }

/* チップの中身をチェックボックス／ラジオにする（JSなしで選べる） */
.chip-check { display: inline-flex; align-items: center; gap: 6px; }
.chip-check:focus-within { border-color: var(--matcha-line); box-shadow: 0 0 0 3px var(--matcha-soft); }
.chip-check:has(input:checked) {
  background: var(--matcha-soft); border-color: var(--matcha-line);
  color: var(--matcha-deep); font-weight: 600;
}
.chip-day { font-family: var(--font-serif); font-size: 11px; color: var(--matcha-deep); }

/* 公開範囲のセグメント（button ではなく radio で作る） */
.segment label {
  flex: 1; text-align: center; padding: 9px 4px;
  border-radius: var(--r-pill); cursor: pointer;
  font-size: 12.5px; color: var(--ink-2);
  transition: all .15s;
}
.segment label:has(input:checked) {
  background: var(--card); color: var(--matcha-deep); font-weight: 600;
  box-shadow: var(--shadow-s);
}

/* 実際の写真（プレースホルダの .photo の中に敷く） */
.photo-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.photo-link { display: block; position: relative; }

/* 投稿画面 */
.cmp-photo-wrap { position: relative; }
.cmp-drop {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--r-l);
  background: var(--washi-2);
  color: var(--ink-3);
  font-family: var(--font-sans);
  cursor: pointer;
}
.cmp-drop:hover { border-color: var(--matcha-line); }
.cmp-drop:focus-within { border-color: var(--matcha-line); box-shadow: 0 0 0 3px var(--matcha-soft); }
.cmp-drop-title { font-family: var(--font-serif); font-size: 14px; color: var(--ink-2); letter-spacing: .06em; }
.cmp-drop-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; text-align: center; }
.cmp-file { font-size: 12px; color: var(--ink-2); max-width: 100%; }

/* 記録の単票 */
.log-actions { display: flex; gap: 10px; padding: 0 16px 16px; }
.log-actions form { margin: 0; }

/* ------------------------------------------------------------
   フィード / なでなで / マイページ / さがす
     モック（home.html・mypage.html・search.html）の <style> と、
     そこで style="" で書かれていた分をクラスに起こしたもの。
     インラインの style 属性は CSP（style-src 'self'）で使えない。
   ------------------------------------------------------------ */

/* タブと FAB は JS なしで動かすため <a> にする（見た目はモックのまま） */
a.tab {
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
a.fab { text-decoration: none; }

.feed-more { padding-top: 0; }

/* なでなで（数は出さない。押した／押していないの2状態だけ） */
.nade-form { margin: 0; }

/* --- マイページ --- */
.me-head { text-align: center; padding-bottom: 6px; }
.me-avatar { width: 56px; height: 56px; font-size: 22px; margin: 0 auto 12px; }
.me-name { margin: 0 0 3px; }
.me-handle { margin: 0 0 10px; }
.me-bio { margin: 0; }
.me-summary { padding-top: 10px; }
.me-countrow { justify-content: center; gap: 6px; }
.me-count-label { font-weight: 600; }
/* 記録数は自分のマイページだけに出す唯一の数字 */
.me-count { font-family: var(--font-serif); color: var(--matcha-deep); }
.me-linkrow {
  width: 100%; text-align: left; text-decoration: none; color: inherit;
  font-family: var(--font-sans);
}
.me-linkrow:hover { background: var(--washi-2); }
.me-chevron { color: var(--ink-3); flex: 0 0 auto; }
.me-inns { padding-top: 0; display: flex; flex-direction: column; gap: 10px; }
.me-inn { display: block; text-decoration: none; color: inherit; }
.me-inn-body { min-width: 0; }
.me-inn-name { margin: 0 0 2px; font-weight: 600; }
.me-inn-pref { margin: 0; }
/* 公開範囲が self のタイルに重ねる鍵 */
.me-lock {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; padding: 4px; box-sizing: border-box;
  border-radius: var(--r-pill);
  background: rgba(45,42,36,.34);
  color: #fff;
}
.me-settings { border-top: 1px solid var(--line-soft); margin-top: 10px; }
.me-logout form { margin: 0; }

/* --- さがす --- */
.srch-section { padding-top: 0; }
.srch-submit { margin-top: 14px; }
.srch-inn { display: block; text-decoration: none; color: inherit; }

/* なでなでの文言えらび（記録の単票） */
.nade-choices { padding: 4px 14px 14px; }
.nade-choices .t-mini { margin: 0 0 9px; }
.nade-choices .nade-form { display: flex; flex-wrap: wrap; gap: 8px; }
