/* =========================================================
   LoveMeter - style.css（スマホ最適・白基調＆かわいい）
   外部フォント/ライブラリ不使用・完全ローカル
========================================================= */
:root{
  --bg: #ffffff;
  --text: #222;
  --muted: #666;
  /* iPhoneで薄く見えにくい問題の対策（やや濃いめ） */
  --line: #d0d5dd;
  --card: #fff;

  --accent: #ff86b7;
  --accent-2: #ffd8e9;
  --accent-3: #fff1f7;
  /* プログレスのトラックを少し濃くして視認性UP */
  --track: #e9edf3;

  --success:#2fb47c;
  --warn:#f0b429;
  --danger:#ff4d6d;

  --radius: 16px;
  --shadow: 0 6px 18px rgba(0,0,0,.06);
  --shadow-soft: 0 3px 10px rgba(0,0,0,.05);

  --ring-size: 96px;
}

*{ box-sizing: border-box; }
html,body{
  height:100%;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}
.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 12px calc(86px + env(safe-area-inset-bottom,0px));
}
h1,h2,h3{ margin: 0 0 8px; }
h1{ font-size: 22px; letter-spacing: .3px; }
h3{ font-size: 16px; }
p{ margin: 6px 0; }

/* ヘッダー */
.header{
  background: var(--card);
  border: 1.25px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  margin-bottom: 12px;
}
.header .row{
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
}
.header .sub{
  color: var(--muted);
  margin-top: 6px;
}

/* 汎用UI */
.card{
  background: var(--card);
  border: 1.25px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}
.grid{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
.row{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lbl{
  display:block;
  font-size: 12px;
  color: #444;
  margin-bottom: 6px;
}
.input, .select, .textarea{
  width: 100%;
  font-size: 16px;
  border: 1.25px solid var(--line);
  background: #fff;
  color: #222;
  border-radius: 14px;
  padding: 12px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.02);
  accent-color: var(--accent);
}
.input:focus, .select:focus, .textarea:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-2);
}
.textarea{
  min-height: 200px;
  resize: vertical;
  border-radius: 14px;
}
.help{
  font-size: 12px;
  color: var(--muted);
}
.hint{
  font-size: 12px;
  color: #889;
}

.badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b03065;
  background: var(--accent-3);
  border: 1.25px solid var(--accent-2);
  border-radius: 999px;
  padding: 4px 10px;
}
.badge.alt{
  color: #5e5e5e;
  background: #f6f7f9;
  border-color: var(--line);
}

/* ドロップ領域（見た目は残す） */
.drop{
  margin-top: 10px;
  border: 1.25px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

/* 結果 */
.result{ margin-top: 12px; }
.kpi{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}
.kpiCard{
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1.25px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.cap{ font-size: 12px; color: #667; }
.big{ font-size: 22px; font-weight: 700; }

/* プログレスバー */
.bar{
  position: relative;
  height: 12px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
  border: 1px solid rgba(0,0,0,.04);
}
.bar > span{
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff9fc6);
}

/* リングゲージ */
.ring{
  width: var(--ring-size);
  height: var(--ring-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #444;
  background:
    conic-gradient(var(--accent) var(--deg), var(--track) 0 360deg);
  position: relative;
  user-select: none;
}
.ring::after{
  content:"";
  position: absolute;
  inset: 9px;
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.25px var(--line);
}
.ring[data-zone="mid"]{ --accent:#f7a74f; }
.ring[data-zone="low"]{ --accent:#9aa4b2; }

/* ミニグリッド */
.miniGrid{
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}
.miniGrid > div{
  border: 1.25px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

/* 理由・内訳 */
.explain{ margin-top: 6px; }
.reasons{
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}
.reasons li{
  position: relative;
  padding-left: 20px;
  margin: 6px 0;
}
.reasons li::before{
  content: "•";
  color: var(--accent);
  position: absolute; left: 6px; top: 0;
}
.breakdown{
  margin-top: 8px;
  border: 1.25px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.bd{ display: grid; gap: 6px; }
.bd-row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed #eff0f2;
}
.bd-row:last-child{ border-bottom: none; }

/* 相手メモ & 提案 */
#memo .reasons li{ padding-left: 0; }
#memo .reasons li::before{ content: ""; }
#memo .cap{ margin-bottom: 4px; }
#suggestions .reasons li strong{
  display:inline-block; min-width:4.5em; color:#5d6470;
}

/* フッター */
.footer{
  text-align: center;
  color: #98a;
  font-size: 12px;
  margin-top: 16px;
}

/* ===========================
   固定アクションバー：中央配置
=========================== */
.actionBar{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 99;
  background: #fff;
  border-top: 1.25px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom,0px));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: 0 -8px 18px rgba(0,0,0,.04);
}
.actionBar .spacer{ display:none !important; }

.select.ttl{
  width: 90px;
  padding-right: 26px;
}
.btn{
  appearance: none;
  -webkit-appearance: none;
  border: 1.25px solid var(--line);
  background: #fff;
  color: #333;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 15px;
  min-height: 44px;
  line-height: 1;
  box-shadow: var(--shadow);
}
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #442233;
  border-color: #ffc8dc;
}
.btn.danger{
  background: linear-gradient(180deg, #ffd6de, #ffb6c2);
  color: #611a27;
  border-color: #ffc7d1;
}

/* details / summary */
details{
  background: #fff;
  border: 1.25px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
details[open]{ box-shadow: var(--shadow-soft); }
summary{
  cursor: pointer;
  list-style: none;
  outline: none;
}
summary::-webkit-details-marker{ display:none; }

/* フォーカス可視化 */
:focus-visible{
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

/* レイアウト調整（横幅広め） */
@media (min-width: 560px){
  .grid{ grid-template-columns: 1fr 1fr; }
  .kpi{ grid-template-columns: 1fr 1fr; }
  .miniGrid{ grid-template-columns: 1fr 1fr 1fr; }
  .actionBar{
    max-width: 980px;
    margin: 0 auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
  }
}

/* iOSの余白（セーフエリア） */
@supports(padding:max(0px)){
  .actionBar{
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* ===== 追加: SNSアイコン最適化 & フォロー文言 ===== */
.social-icons{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.social-icons .icon{
  width:24px;
  height:24px;
  display:inline-block;
}
.follow-hint{
  margin-left:4px;
  opacity:.8;
  color:#889;
}

/* ヒントの下に1行分の余白 */
.drop .help{ margin: 6px 0 16px; }

/* タッチ端末（iPhone等）では線をさらに太めに */
@media (pointer: coarse){
  .header, .card, .kpiCard, .miniGrid > div, .drop,
  details, .input, .select, .textarea, .btn, .ring::after {
    border-width: 1.5px;
  }
}

/* ========= 解析中オーバーレイ ========= */
.overlay{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(1.5px);
  z-index: 9999;
}
/* hidden 属性が付いている間は確実に非表示 */
.overlay[hidden]{ display:none !important; }

.overlay-card{
  background: #fff;
  border: 1.25px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.spinner{
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 3px solid var(--track);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.overlay-text{
  font-weight: 700;
  color: #445;
  letter-spacing: .2px;
}
@keyframes spin{
  to { transform: rotate(360deg); }
}
