:root {
  --accent: #be123c; --accent2: #9f1239; --bg: #f1f5f9; --card: #fff;
  --text: #0f172a; --muted: #64748b; --border: #e2e8f0; --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); }
.view { display: none; } .view.is-active { display: block; }
.app-header { position: relative; background: var(--accent); color: #fff; padding: calc(env(safe-area-inset-top) + 16px) 16px 16px; }
.header-actions { display: flex; gap: 8px; flex: none; }
.account-menu-panel {
  position: absolute; right: 16px; top: 52px; z-index: 20;
  background: var(--card); color: var(--text); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18); padding: 10px; min-width: 200px;
  display: flex; flex-direction: column; gap: 4px;
}
.account-menu-email { margin: 0 0 4px; padding: 0 8px; font-size: 0.8rem; color: var(--muted); }
.account-menu-link {
  display: block; padding: 8px; border-radius: 8px; border: none; background: none;
  color: var(--text); text-align: left; font-size: 0.9rem; text-decoration: none; cursor: pointer;
}
.account-menu-link:hover { background: var(--bg); }
.app-header .header-row { display: flex; align-items: center; justify-content: space-between; }
.app-header h1 { margin: 0; font-size: 1.35rem; }
.app-header .sub { margin: 4px 0 0; font-size: .82rem; opacity: .85; }
.app-header .help-btn {
  width: 32px; height: 32px; border-radius: 999px; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.15);
  color: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.help-panel {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.help-panel[hidden] { display: none; }
.help-card { background: var(--card); border-radius: 14px; padding: 20px; max-width: 420px; max-height: 80vh; overflow-y: auto; color: var(--text); }
.help-card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.help-card ul { margin: 0 0 16px; padding-left: 18px; }
.help-card li { margin-bottom: 8px; font-size: 0.9rem; line-height: 1.5; }
.draft-link { display: inline-block; margin-top: 10px; font-size: .82rem; font-weight: 700; color: #fff; text-decoration: none; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 6px 12px; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.card h3 { margin: 14px 0 6px; font-size: .95rem; }
select { width: 100%; padding: 12px; font-size: 1rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.muted { color: var(--muted); font-size: .85rem; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 2px solid transparent; border-radius: 12px; background: var(--bg); cursor: pointer; }
.profile-card img { width: 56px; height: 56px; border-radius: 50%; }
.profile-card.is-selected { border-color: var(--accent); background: #e2e8f0; }
.profile-name { font-size: .78rem; font-weight: 700; text-align: center; }
.profile-tag { font-size: .68rem; color: var(--muted); }
.btn { display: block; width: 100%; padding: 14px; font-size: 1rem; font-weight: 700; border: none; border-radius: 12px; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; } .btn-primary:disabled { opacity: .5; }
.message { margin: 12px 0 0; font-size: .9rem; } .message.error { color: var(--danger); }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.history-list li:last-child { border-bottom: none; }
.history-meta { color: var(--muted); font-size: .76rem; }
.empty { color: var(--muted); font-size: .9rem; }

/* Zoom風セッション画面 */
#session { background: #0f172a; height: 100vh; }
.call-stage { position: relative; height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; }
.call-main { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar-img { width: min(60vw, 260px); height: min(60vw, 260px); border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.06); }
.avatar-name { color: #fff; font-size: 1.1rem; font-weight: 700; }
.self-video { position: absolute; right: 16px; bottom: 16px; width: 100px; height: 130px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255,255,255,.3); background: #1e293b; }
.call-timer { position: absolute; top: 16px; left: 16px; color: #fff; font-variant-numeric: tabular-nums; font-size: .95rem; background: rgba(255,255,255,.1); padding: 4px 10px; border-radius: 999px; }
.caption-box { position: absolute; bottom: 100px; left: 16px; right: 16px; color: #e2e8f0; font-size: .92rem; text-align: center; min-height: 1.4em; }
.call-controls { height: 80px; display: flex; align-items: center; justify-content: center; gap: 12px; background: #0f172a; border-top: 1px solid #1e293b; }
.ctrl-btn { padding: 10px 18px; border-radius: 999px; border: none; background: #334155; color: #fff; font-weight: 700; cursor: pointer; }
.ctrl-end { background: var(--danger); }

.score-row { display: flex; gap: 12px; margin-bottom: 10px; }
.score-box { flex: 1; background: var(--bg); border-radius: 12px; padding: 14px; text-align: center; }
.score-num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.score-label { font-size: .8rem; color: var(--muted); font-weight: 700; }

/* --- log-series UI/UX標準（共通適用） --------------------------------------- */
/* hidden属性がdisplay指定に負けて非表示が壊れる事故の防止（標準§2 実装ノートA） */
[hidden] { display: none !important; }
/* キーボード操作のフォーカスを常に見えるように（a11y） */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent2, var(--accent, #7c3aed));
  outline-offset: 2px;
}
/* 全画面フッター（プライバシー/規約は中央 auth.log-series.jp に集約。標準§10） */
.app-footer {
  text-align: center; padding: 20px 12px calc(16px + env(safe-area-inset-bottom));
  color: var(--muted, #71717a); font-size: 0.85rem;
}
.app-footer a { color: var(--muted, #71717a); text-decoration: underline; }

/* --- フォーム部品標準: ネイティブ部品をブラウザ標準のままにせずアプリ色に --------- */
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;
}

/* ---- ヘッダーのサービス名（全アプリ共通）------------------------------------
   押すとそのサービスのホームへ戻る。log-series 表記はフッターだけに置く。 */
.app-home {
  display: inline-flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none;
}
.app-home:hover { opacity: .85; }
.series-mark { flex: none; }

/* フッターの log-series も同じ見え方に揃える（色は文字色まかせ） */
.footer-home {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px auto 0; color: inherit; text-decoration: none;
  opacity: .7; font-size: .82rem; font-weight: 700;
}
.footer-home:hover, .footer-home:focus-visible { opacity: 1; }
