:root{
  --bg:#eaf6ff;              /* うすい水色 */
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:rgba(15, 23, 42, .10);
  --accent:#2aa7ff;          /* アクセント（水色寄り） */
  --accentDeep:#1b8fe0;
  --shadow: 0 10px 30px rgba(2, 132, 199, .08);
}

*{ box-sizing:border-box; }

html, body{ height: 100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  /* radial-gradient(900px 500px at 20% 0%, rgba(42,167,255,.22), transparent 55%),
              radial-gradient(900px 500px at 80% 10%, rgba(34,211,238,.18), transparent 50%),
              var(--bg); */
  color:var(--text);
  min-height: 100vh;
}

.container{
  max-width: 920px;
  margin: 0 auto;
  padding: 26px 16px 56px;
  min-height: 100vh;
}

.pageHeader{
  margin-bottom: 14px;
  padding: 18px 18px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
}

.pageHeader h1{
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: .02em;
}

.muted{
  color: var(--muted);
  font-size: 14px;
}

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.cardHover:hover{
  transform: translateY(-1px);
  transition: transform .12s ease;
}

.cardLink{
  text-decoration: none;
  color: inherit;
  display:block;
}

.row,
.form .row{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:14px;
}

/* ラベル + 入力を2行にしたい時用 */
.row.stackRow{ flex-direction: column; }

/* ===== 学年 + セレクトを1行にする ===== */
.grid3 > .row{ margin-bottom: 0; } /* gridのgapに任せる */

.row.inlineRow{
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.row.inlineRow .miniLabel{
  font-size: 15px;
  color: var(--text);
  margin-bottom: 0;
  white-space: nowrap;
}

.row.inlineRow .select{
  flex: 1;
  min-width: 0;
}

label{
  font-size: 12px;
  color: var(--muted);
}

.miniLabel{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.help{
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

input, .select{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  outline:none;
  background: #fff;
}

input:focus, .select:focus{
  border-color: rgba(42,167,255,.8);
  box-shadow: 0 0 0 5px rgba(42,167,255,.18);
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.grid3{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:10px;
}

@media (max-width: 720px){
  .grid2, .grid3{ grid-template-columns:1fr; }
}

.btnPrimary{
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(180deg, var(--accent), var(--accentDeep));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(42,167,255,.22);
}

.btnPrimary:disabled{ opacity:.65; cursor:not-allowed; }

.btnGhost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border: 1px solid rgba(42,167,255,.35);
  background: rgba(42,167,255,.10);
  color: #075985;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* ボタンをカード外に出した時の共通レイアウト */
.actions{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actions.actionsTight{ margin-top: 12px; }

/* result は中央寄せ */
.actions .result{ margin-top: 0; text-align: center; }

/* list.html：検索バー + フィルターボタン */
.searchHeader{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

/* フィルター文字は左寄せ */
.searchHeader .filterToggle{
  align-self: flex-start;
}

/* HTML側がまだbtnGhostのままでも左寄せにする保険 */
.searchHeader #filterToggleBtn{
  align-self: flex-start;
}

.filtersPanel{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px){
  .searchHeader{ flex-direction: column; align-items: stretch; }
}

.result{ margin-top: 12px; text-align: center; }
.ok{ color: #16a34a; font-weight: 700; }
.ng{ color: #dc2626; font-weight: 700; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.preview{
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  display: none;
}

.profileTop{ display:flex; gap:14px; align-items:center; }

/* ===== list.html: プロフィールカード新レイアウト ===== */
.profileHead{
  display:flex;
  gap:14px;
  align-items:center;
}

.profileHeadMain{ flex: 1; min-width: 0; }

.profileName{
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.profileAff{ margin: 0; }

.pillRow{
  margin-top: 10px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

/* Instagramボタン（都道府県ピルと同じ形で、Instagramっぽい色合い） */
.pill.pillInsta{
  border: 0;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg,
    #f58529 0%,
    #dd2a7b 35%,
    #8134af 70%,
    #515bd4 100%
  );
  /* box-shadow: 0 10px 24px rgba(221, 42, 123, .18); */
  box-shadow: none;
}

.pill.pillInsta:hover{
  filter: saturate(1.05) brightness(.98);
}

.pill.pillInsta:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 5px rgba(221, 42, 123, .22),
    0 10px 24px rgba(221, 42, 123, .18);
}

.profileGrid .kvFull{ grid-column: 1 / -1; }

/* profile 詳細：ラベルと値を横並びにする */
.profileGrid .kv{
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.profileGrid .kv .k{
  width: 92px;        /* ←ラベル列の幅（好みで調整） */
  margin: 0;          /* ←下の余白を消す */
}

.profileGrid .kv .v{
  flex: 1;
}

/* クラス（ピル）だけは上揃え＆折り返し */
.profileGrid .kv.kvFull{
  align-items: flex-start;
}
.profileGrid .kv.kvFull .v{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* スマホは縦に戻す（見やすさ優先） */
/* @media (max-width: 520px){
  .profileGrid .kv{
    flex-direction: column;
    gap: 6px;
  }
  .profileGrid .kv .k{
    width: auto;
  }
} */

.classPills{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;       /* できるだけ1行 */
  overflow-x:auto;        /* 画面が狭いときは横スクロール */
  padding-bottom: 2px;    /* スクロールバーと干渉しにくく */
}

.classPills::-webkit-scrollbar{ height: 8px; }
.classPills::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.12);
  border-radius: 999px;
}


.avatar{
  width: 92px;
  height: 92px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.avatarPlaceholder{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#94a3b8;
  font-size: 12px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(2,132,199,.06);
  font-size: 12px;
  color: #0f172a;
}

.pillSoft{
  background: rgba(15,23,42,.04);
}

.profile .kv{ padding: 10px 0; }
.k{ color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.v{ font-size: 15px; }

.divider{
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

/* list.html: 検索 + フィルター */
.searchHeader{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.filtersPanel{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px){
  .searchHeader{ flex-direction: column; align-items: stretch; }
}

.footer{
  margin-top: 18px;
  text-align:center;
  color: rgba(15,23,42,.55);
  font-size: 12px;
}

/* フィルター：ボタンっぽくしない（灰色テキスト + 矢印） */
/* ただの文字っぽいトグル（太字・灰色・左寄せ） */
.filterToggle{
  appearance: none;
  -webkit-appearance: none;

  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;

  color: rgba(15,23,42,.55);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;

  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  text-align: left;

  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.filterToggle:focus{ outline: none; }
.filterToggle:focus-visible{
  outline: none;
  text-decoration: none;
}

.filterToggle .chev{
  display: inline-block;
  transition: transform .15s ease;
  font-size: 18px;
  line-height: 1;
}

.filterToggle[aria-expanded="true"] .chev{
  transform: rotate(90deg);
}

/* 検索 + フィルター：常に縦並び（PCでも改行） */
.searchHeader{
  display: flex;
  flex-direction: column;   /* ←改行固定 */
  align-items: stretch;
  gap: 10px;
}

/* フィルター文字は左寄せ */
.searchHeader .filterToggle{
  align-self: flex-start;
}

/* ===== Crop Modal ===== */
.cropModal{
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.cropSheet{
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}

.cropTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15,23,42,.10);
  position: relative;
}

.cropTitle{
  font-weight: 800;
  font-size: 14px;

  /* ★追加：強制的にど真ん中に配置します */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap; /* 文字が折り返されないようにする */
}

.cropLink{
  border: 0;
  background: transparent;
  padding: 6px 8px;
  color: rgba(15,23,42,.65);
  font-weight: 700;
  cursor: pointer;
}
.cropLink.strong{ color: rgba(15,23,42,.9); }

.cropStageWrap{
  padding: 14px;
  background: #fff;
}

.cropStage{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 正方形 */
  background: #0b1220;
  overflow: hidden;

  /* ピンチ/ドラッグを自前で扱うため */
  touch-action: none;
  user-select: none;
}

#cropImg{
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}

/* 周りを暗くするマスク（中央は透明） */
.cropMask{
  position:absolute;
  inset:0;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45) inset;
  pointer-events:none;
}

/* 正方形の枠線 */
.cropFrame{
  position:absolute;
  inset:0;
  border: 2px solid rgba(255,255,255,.85);
  pointer-events:none;
}

.cropBottom{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(15,23,42,.10);
}

.cropZoom{
  width: 42px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.16);
  background: rgba(15,23,42,.05);
  font-weight: 900;
  cursor: pointer;
}

.cropHint{
  flex:1;
  font-size: 12px;
  color: rgba(15,23,42,.55);
}
