/* =========================================================
   pages.css — 1画面にしか出ないもの（ニューモーフィズム）
   ========================================================= */

/* ── サインイン（index.html）──────────────────────── */
.signin{
  min-height: 100dvh;
  display: grid;
  align-content: center;
  gap: 20px;
  max-width: var(--col);
  margin-inline: auto;
  padding: 36px var(--gut) calc(36px + env(safe-area-inset-bottom));
  background: var(--nm-bg);
}
.signin .mark{
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--accent-deep);
}
.signin h1{ font-size: 28px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
.signin .lead{ font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.85; }
.field{ display: grid; gap: 7px; }
.field label{ font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); }
/* 入力欄は「溝」。押すものではなく、書き込むもの */
.field input{
  width: 100%;
  min-height: var(--tap);
  padding: 13px 17px;
  font-size: 16px;            /* iOS で入力時に拡大させない */
  color: var(--ink);
  background: var(--nm-bg);
  border: 0;
  border-radius: var(--r-btn);
  box-shadow: var(--nm-in-sm);
}
.field input::placeholder{ color: var(--ink-3); }
.field input:focus-visible{ outline: 3px solid var(--accent-deep); outline-offset: 2px; }

/* ── ホーム ───────────────────────────────────── */
.rank-mine{
  display: flex;
  align-items: center;
  gap: 14px;
}
.rank-mine .badge{
  width: 58px; height: 58px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--nm-bg);
  box-shadow: var(--nm-up-sm);
  color: var(--accent-deep);
}
.rank-mine .badge b{ font-family: var(--ff-num); font-size: 21px; font-weight: 600; line-height: 1; }
.rank-mine .badge span{ font-size: 12px; font-weight: 600; }
.rank-mine .txt b{ font-size: var(--fs-h3); font-weight: 600; }
.rank-mine .txt p{ font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.65; }

/* ── 投稿する ─────────────────────────────────── */
.step{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.step i{
  width: 26px; height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--nm-bg);
  box-shadow: var(--nm-up-sm);
  color: var(--accent-deep);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; font-style: normal;
}
.step b{ font-size: var(--fs-h3); font-weight: 600; }

/* 写真は縦に並べる格子。★横スクロールにしない（スワイプが二重になる） */
.grid-photo{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.thumb{
  position: relative;
  aspect-ratio: 3 / 4;
  border: 0;
  padding: 0;
  border-radius: var(--r-thumb);
  cursor: pointer;
  background: var(--nm-bg);
  box-shadow: var(--nm-up-sm);
  transition: box-shadow 90ms var(--ease);
}
.thumb:active{ box-shadow: var(--nm-in-sm); }
.thumb:focus-visible{ outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.thumb .ph{
  position: absolute; inset: 5px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink-2);
  background: repeating-linear-gradient(135deg, #EAE0E1 0 10px, #E4D9DB 10px 20px);
}
.thumb .mv{
  position: absolute; left: 9px; bottom: 9px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(43, 36, 39, .70);
  color: #fff;
  font-size: 12px;
  font-family: var(--ff-num);
}
/* 選択の印は「塗り＋チェック」。影の向きだけに頼らない */
.thumb .pick{
  position: absolute; right: 8px; top: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--nm-bg);
  box-shadow: var(--nm-in-sm);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
}
.thumb[aria-pressed="true"]{ box-shadow: var(--nm-in-sm); }
.thumb[aria-pressed="true"] .ph{ outline: 2px solid var(--accent-deep); outline-offset: -2px; }
/* ── 実ファイルを扱うようになって足した分（2026-09-04）────── */
.thumb-wrap{ position: relative; }
.thumb-wrap .thumb{ width: 100%; display: block; overflow: hidden; }
.thumb img{
  position: absolute; inset: 5px;
  width: calc(100% - 10px); height: calc(100% - 10px);
  object-fit: cover; object-position: top center;
  border-radius: 9px;
}
/* 送信中・失敗の帯。押せない状態を色と文字の両方で示す */
.thumb .upl{
  position: absolute; left: 5px; right: 5px; bottom: 5px;
  padding: 4px 0;
  border-radius: 0 0 9px 9px;
  background: rgba(43, 36, 39, .72);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
}
.thumb .upl.bad{ background: var(--on-accent); }
.thumb[disabled]{ opacity: .72; cursor: default; }
/* はずすボタン。指で押せる大きさを確保する */
.thumb-x{
  position: absolute; top: -8px; right: -8px;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: var(--on-accent); color: var(--white);
  font-size: 17px; line-height: 1;
  box-shadow: var(--nm-up-sm);
  cursor: pointer;
}
.thumb-x:focus-visible{ outline: 3px solid var(--ink); outline-offset: 2px; }

/* 文章を書く欄。見本の .draft と同じ見た目のまま入力できるようにする */
.draft-in{
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 18px;
  font-size: var(--fs-body);      /* 🔴 16px 未満にしない。iOS が勝手に拡大する */
  line-height: 1.9;
  color: var(--ink);
  background: var(--nm-sunk);
  box-shadow: var(--nm-in-sm);
  resize: vertical;
  min-height: 132px;
}
.draft-in::placeholder{ color: var(--ink-3); }
.draft-in:focus-visible{ outline: 3px solid var(--accent-deep); outline-offset: 2px; }

.mic .circle{ border: 0; cursor: pointer; }

/* お店の確認画面の写真。1枚だけの時に画面いっぱいの縦長にしない */
.grid-photo--rev{
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.grid-photo--rev .thumb{ pointer-events: none; }

/* ── 定型文（2026-09-04）───────────────────────────
   えらぶと本文へ差し込むだけ。AIが文章を作るわけではない。
   差し込んだあとに直せることが判るよう、すぐ下に「自分で直す」を置く。 */
.tpl{ margin-bottom: 14px; }
.tpl__ttl{
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  margin: 0 0 10px;
  font-size: var(--fs-label); font-weight: 600; color: var(--ink-2);
}
.tpl__sub{ font-weight: 400; color: var(--ink-3); }
.tpl__list{ display: flex; flex-wrap: wrap; gap: 8px; }
.tpl__btn{
  min-height: 44px;                /* 指で押せる下限（DESIGN_LAWS 22-8）*/
  max-width: 100%;
  padding: 10px 16px;
  border: 0; border-radius: var(--r-chip);
  background: var(--nm-bg); box-shadow: var(--nm-up-sm);
  color: var(--ink); font-size: var(--fs-sm); font-weight: 600;
  line-height: 1.4; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tpl__btn:active{ box-shadow: var(--nm-in-sm); }
.tpl__btn:focus-visible{ outline: 3px solid var(--accent-deep); outline-offset: 3px; }
/* 店の共有分は、誰のものか判るように印を付ける（色だけに頼らない） */
.tpl__btn--shared::before{ content: "店 "; color: var(--on-accent); font-weight: 700; }

.cap-row{
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-top: 12px;
}
.cap-row__btns{ display: flex; gap: 8px; }
.cap-row .btn{ width: auto; }

/* 定型文をつくる欄。ふだんは畳んでおく */
.fold{
  margin-top: 20px;
  border-radius: var(--r-card);
  background: var(--nm-bg);
  box-shadow: var(--nm-up-sm);
  overflow: hidden;
}
.fold > summary{
  min-height: 48px;
  display: flex; align-items: center;
  padding: 14px 20px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink);
  cursor: pointer; list-style: none;
}
.fold > summary::-webkit-details-marker{ display: none; }
.fold > summary::after{ content: "＋"; margin-left: auto; color: var(--ink-3); }
.fold[open] > summary::after{ content: "－"; }
.fold > summary:focus-visible{ outline: 3px solid var(--accent-deep); outline-offset: -3px; }
.fold__in{ padding: 0 20px 20px; }
.tpl__share{
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; margin-top: 12px;
  font-size: var(--fs-sm); color: var(--ink-2);
}
.tpl__share input{ width: 22px; height: 22px; accent-color: var(--accent-deep); }

/* 登録済みの一覧（消す・直す） */
.tpl-row{
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px;
  align-items: center; padding: 12px 0;
  border-top: 1px solid var(--line);
}
.tpl-row b{ display: block; font-size: var(--fs-sm); font-weight: 600; }
.tpl-row span{ display: block; font-size: var(--fs-label); color: var(--ink-3); line-height: 1.6; }
.tpl-row .btn{ width: auto; }

/* 出し先の注意書き。黙って落とさず、その場に出す */
.warn{
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-btn);
  background: var(--nm-sunk);
  box-shadow: var(--nm-in-sm);
  color: var(--on-accent);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.8;
}

/* ホットペッパーの結果を入れる欄（店長の確認画面）*/
.hpb-fix{
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--r-btn);
  background: var(--nm-sunk);
  box-shadow: var(--nm-in-sm);
}
.sel{
  display: block; width: 100%;
  min-height: 48px;                /* 指で押せる下限 */
  padding: 12px 14px;
  border: 0; border-radius: var(--r-btn);
  background: var(--nm-bg); box-shadow: var(--nm-up-sm);
  color: var(--ink);
  font-size: var(--fs-body);       /* 16px 未満にしない（iOS が拡大する）*/
  line-height: 1.5;
}
.sel:focus-visible{ outline: 3px solid var(--accent-deep); outline-offset: 2px; }
.hpb-fix .draft-in{ margin-top: 10px; min-height: 88px; }
/* 読み上げ用のラベル。甲板の外なので .sr を使ってよいが、書き方は揃える */
.sr-lbl{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 管理画面の上帯はボタンが3つ並ぶ。320pxでは1行に収まらないので折り返す。
   折り返さないと .app 全体が広がり、ページごと横スクロールする（2026-09-05 実測）。 */
.app > .topbar{ flex-wrap: wrap; row-gap: 8px; }
.topbar .btn{ flex: 0 1 auto; min-width: 0; }

/* 管理画面：行の操作。48pxのタップ域を保つ（DESIGN_LAWS 21-3）*/
.row-act{ display: flex; flex-wrap: wrap; gap: 8px; }
.row-act .btn{ width: auto; white-space: nowrap; }
.tbl td{ vertical-align: middle; }

/* 出すお店の選択。店の数だけ増えるので、3列固定にしない */
.seg--store{
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  margin-left: 0;
}
.seg--store label{ padding: 0 8px; }

/* 表は横スクロールできる箱に入れる（DESIGN_LAWS 22-8／管理画面の表を潰さない）*/
.tbl-wrap{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap .tbl{ min-width: 260px; }

/* ポイントの式。表に「まだ」の行を並べるより仕組みが1目で判る */
.pt-eq{
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}
.pt-eq__box{
  display: grid; place-items: center; gap: 2px;
  min-width: 0;
  padding: 14px 4px;
  border-radius: 12px;
  background: var(--nm-bg);
  box-shadow: var(--nm-in-sm);
  text-align: center;
}
.pt-eq__box b{
  font-family: var(--ff-num); font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--ink);
}
.pt-eq__box span{ font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.pt-eq__box--sum{ box-shadow: var(--nm-up-sm); }
.pt-eq__box--sum b{ color: var(--on-accent); }
.pt-eq__op{ font-size: var(--fs-sm); color: var(--ink-3); }

/* わたしの投稿：実際の写真とお店からの伝言 */
img.pic{ object-fit: cover; object-position: top center; }
.post-row .met.back{ color: var(--on-accent); font-weight: 600; }

.thumb[aria-pressed="true"] .pick{
  background: var(--on-accent);
  color: var(--white);
  box-shadow: none;
}

.draft{
  border-radius: 12px;
  padding: 18px;
  font-size: var(--fs-sm);
  line-height: 1.95;
  color: var(--ink-2);
  background: var(--nm-bg);
  box-shadow: var(--nm-in-sm);
}
.draft .tag{ color: var(--accent-deep); }
.mic{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-btn);
  background: var(--nm-bg);
  box-shadow: var(--nm-up-sm);
}
.mic .circle{
  width: 44px; height: 44px;   /* 指で押すボタンになったので 44px（DESIGN_LAWS 22-8）*/
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--white);
  display: grid; place-items: center;
}
.mic p{ font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.65; }

/* 出し先のチェック */
.dest{ display: grid; gap: 10px; }
/* グリッド／フレックスの項目は既定が min-width:auto で、中身より縮まない。
   和文の .sub が長いため 320px で20pxはみ出していた（2026-09-04 実測・既存分も含む）。 */
.dest > *, .dest-item, .dest label > span, .seg{ min-width: 0; }
.dest label{
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 13px 16px;
  border-radius: var(--r-btn);
  background: var(--nm-bg);
  box-shadow: var(--nm-up-sm);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.dest label:active{ box-shadow: var(--nm-in-sm); }
.dest input{ width: 22px; height: 22px; accent-color: var(--accent-deep); flex: 0 0 auto; }
.dest .who{ display: block; font-weight: 600; }
.dest .sub{ display: block; font-size: var(--fs-label); color: var(--ink-3); line-height: 1.55; }

/* ── 出し先のうち Instagram だけ、出し方を選ぶ（2026-09-04）──────
   フィード＝残る／ストーリー＝24時間で消える。作品を店に残すのが目的なので
   既定は「両方」にしてある（配点と同じくたたき台。Dityca様と決める）。
   チェックを外した出し先では選ぶ意味がないので JS で隠す。 */
.dest-item{ display: grid; gap: 8px; }

.seg{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-left: 34px;              /* チェックボックスの分だけ下げて、どの行の設定か判るようにする */
  border-radius: var(--r-btn);
  background: var(--nm-sunk);
  box-shadow: var(--nm-in-sm);
}
.seg label{
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;               /* 指で押せる下限 */
  padding: 0 4px;
  border-radius: 9px;
  font-size: var(--fs-label);
  line-height: 1.4;
  color: var(--ink-3);
  cursor: pointer;
  text-align: center;
}
/* ネイティブのラジオは隠す。ただし消さない（キーボードと読み上げのため） */
.seg input{
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
/* 🔴 選ばれている方は塗りつぶす。
   地と同じ色で浮かせるだけだと、面の差が 1.07:1 しかなく（実測）
   明るいサロンの店内では影が飛んでどれを選んでいるか判らなくなる。
   components.css の「主要な操作は塗りつぶす」と同じ考え方。白文字は 6.09:1。 */
.seg input:checked + span{ font-weight: 700; color: var(--white); }
.seg label:has(input:checked){
  background: var(--on-accent);
  box-shadow: var(--nm-up-sm);
}
.seg label:has(input:focus-visible){ outline: 3px solid var(--accent-deep); outline-offset: 2px; }

@media (max-width: 359px){
  /* 狭い端末では3つ横並びが窮屈になるので字だけ詰める（縦積みにはしない＝押し間違えるため） */
  .seg{ margin-left: 0; }
  .seg label{ font-size: 11.5px; letter-spacing: -.02em; }
}

/* ── わたしの投稿 ─────────────────────────────── */
.post-row{
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}
.post-row:last-child{ border-bottom: 0; }
.post-row .pic{
  width: 58px; aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: repeating-linear-gradient(135deg, #EAE0E1 0 8px, #E4D9DB 8px 16px);
  box-shadow: var(--nm-up-sm);
}
.post-row .ttl{ display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.55; }
.post-row .met{ display: block; font-size: var(--fs-label); color: var(--ink-3); line-height: 1.65; }
.post-row .pt{
  font-family: var(--ff-num);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-deep);
  white-space: nowrap;
}

/* ── ランキング ───────────────────────────────── */
.rank-row{
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
}
.rank-row + .rank-row{ margin-top: 6px; }
/* 順位の番号は置かない。「上下を決めるものではない」と書いている以上、
   1・2・3 が並んでいると文言と矛盾する（2026-09-04 岩田さん指摘）*/
.rank-row .ini{
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--nm-bg);
  box-shadow: var(--nm-in-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.rank-row .nm{ display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
.rank-row .sub{ display: block; font-size: var(--fs-label); color: var(--ink-3); line-height: 1.55; }
.rank-row .pt{
  font-family: var(--ff-num);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
/* 自分の行だけ塗る。名前にも「（あなた）」と書いてあり、色だけに頼っていない */
.rank-row.me{
  background: var(--on-accent);
  color: var(--white);
  box-shadow: var(--nm-up-sm);
}
.rank-row.me .sub{ color: #FFFFFF; }
.rank-row.me .ini{ background: rgba(255,255,255,.18); box-shadow: none; color: #FFFFFF; }

/* 店舗別の合計 */
.shop-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  font-size: var(--fs-sm);
}
.shop-row + .shop-row{ border-top: 1px solid var(--line); }
.shop-row .pt{
  font-family: var(--ff-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* ── 連携 ─────────────────────────────────────── */
/* 流れは文章の箱ではなく図で見せる（美容師さんは文字が多いと読まない＝検査【11】）*/
.dia{ display: block; width: 100%; height: auto; }

.flow{ display: grid; gap: 10px; }
.flow > div{
  background: var(--nm-bg);
  border-radius: var(--r-btn);
  padding: 16px 18px;
  box-shadow: var(--nm-up-sm);
}
.flow b{ font-size: var(--fs-sm); font-weight: 600; }
.flow p{ font-size: var(--fs-label); color: var(--ink-2); line-height: 1.75; }
.flow .arrow{
  background: none;
  box-shadow: none;
  padding: 0;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
}

.qa{ border-top: 1px solid var(--line); padding: 16px 0; }
.qa:first-child{ border-top: 0; padding-top: 0; }
.qa:last-child{ padding-bottom: 0; }
.qa b{ display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.65; }
.qa p{ font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.75; margin-top: 4px; }
.qa .no-{ color: var(--accent-deep); font-weight: 600; }
