:root {
  --accent: #0f766e; --accent2: #14b8a6; --bg: #faf5ff; --card: #ffffff;
  --text: #2e1065; --muted: #71717a; --border: #e4e4e7; --ok: #16a34a; --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg); color: var(--text);
}
.app-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--accent);
  color: #fff; padding: env(safe-area-inset-top) 0 0;
}
.header-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.app-header h1 { margin: 0; font-size: 1.25rem; }
.logout-btn {
  background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 0.8rem; cursor: pointer;
}
.tabs { display: flex; gap: 4px; padding: 0 8px 8px; }
.tab {
  flex: 1; border: none; background: transparent; color: rgba(255, 255, 255, 0.7);
  padding: 10px 8px; font-size: 0.9rem; font-weight: 600; border-radius: 10px 10px 0 0;
  border-bottom: 3px solid transparent; cursor: pointer;
}
.tab.is-active { color: #fff; background: rgba(255, 255, 255, 0.12); border-bottom-color: #fff; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.is-active { display: block; }

.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(46, 16, 101, 0.06); }

/* --- フォーム部品標準: ネイティブ部品をブラウザ標準のままにせずアプリ色に --------- */
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }
input[type="file"] {
  width: 100%; padding: 10px; box-sizing: border-box;
  border: 1px dashed var(--border); border-radius: 10px;
  background: var(--bg); color: var(--muted); font-size: 0.88rem; cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 14px;
  border: 1px solid var(--accent); border-radius: 999px;
  background: var(--card, #fff); color: var(--accent);
  font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: inherit;
}
input[type="file"]::file-selector-button:hover {
  background: color-mix(in srgb, var(--accent) 8%, #fff);
}

/* --- タップ領域標準（§11: 44px以上）------------------------------------- */
/* ヘッダーの丸ボタン（？・人）とタブは指で確実に押せるサイズにする */
.help-btn, .btn-help, .header-icon-btn, .account-btn, .icon-btn {
  min-width: 44px; min-height: 44px;
}
.help-btn, .btn-help, .header-icon-btn, .account-btn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tab { min-height: 44px; }
.coach-controls button, #coach-next, #coach-back, #coach-skip { min-height: 44px; min-width: 44px; }

/* --- 共通チュートリアル（tour.js が使う。全アプリ同一の見た目）------------- */
#ls-tour-highlight {
  position: fixed; z-index: 10001; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
  pointer-events: none;
}
#ls-tour-tooltip {
  position: fixed; z-index: 10002; width: 280px; max-width: calc(100vw - 24px);
  background: #fff; color: #1f2937; border-radius: 14px; padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
#ls-tour-tooltip[hidden], #ls-tour-highlight[hidden] { display: none !important; }
.ls-tour-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
#ls-tour-step { font-size: .72rem; font-weight: 700; color: #6b7280; letter-spacing: .02em; }
#ls-tour-skip {
  background: none; border: none; color: #6b7280; font-size: .95rem; line-height: 1;
  cursor: pointer; min-width: 44px; min-height: 44px;
}
#ls-tour-tooltip p { margin: 0 0 12px; font-size: .93rem; line-height: 1.6; color: #1f2937; }
.ls-tour-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#ls-tour-back, #ls-tour-next {
  min-height: 44px; padding: 10px 18px; border-radius: 10px; font-size: .9rem;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
#ls-tour-back { background: #fff; border: 1px solid #e5e7eb; color: #4b5563; }
#ls-tour-back:disabled { visibility: hidden; }
#ls-tour-next { border: none; background: var(--accent, #7c3aed); color: #fff; }

/* ヘッダーのサービスシンボル。色ベタのヘッダーに白の透過SVGを重ねる。
   高さは見出しの文字に追従させる（em指定）ので、文字サイズを変えても崩れない。 */
.app-logo {
  height: 1.05em; width: auto; flex: none;
  vertical-align: -0.15em; margin-right: .4em;
}

/* ---- フッターのホームロゴ（全アプリ共通）---------------------------------- */
.footer-home {
  display: block; margin: 10px auto 0; width: 116px; line-height: 0;
  opacity: 0.55; transition: opacity .15s ease;
}
.footer-home:hover, .footer-home:focus-visible { opacity: 1; }
.footer-home img { width: 100%; height: auto; display: block; }

/* 数字がいつ時点のものかを、控えめに添える */
.hero-stats-note {
  margin: 8px 0 0; font-size: .72rem; color: var(--muted, #64748b);
}
.hero-stats-note[hidden] { display: none !important; }
