/* ============================================================
   共通スタイル — 全ページ共有
   ============================================================ */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --border: #e2e6ec; --text: #1c2430; --muted: #667085;
  --primary: #1f6feb; --primary-dark: #1a5fca; --primary-soft: #eef4ff;
  --accent: #7c3aed; --sandbox: #b45309; --sandbox-bg: #fff7ed;
  --open: #2563eb; --pending: #b45309; --closed: #16794c;
  --high: #dc2626; --normal: #475569; --low: #64748b;
  --ok: #16794c; --err: #dc2626;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.10);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- サイト共通ヘッダー ---- */
header.site {
  background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 40;
}
.brand { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--primary); display: inline-block; }
.brand a { color: inherit; } .brand a:hover { text-decoration: none; }
.brand .pill { font-size: 11px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 9px; border-radius: 999px; }
nav.top { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
nav.top a { color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
nav.top a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
nav.top a.active { background: var(--primary-soft); color: var(--primary); }
nav.top .who { font-size: 13px; color: var(--muted); }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary); color: #fff; border: none; border-radius: 9px;
  padding: 11px 20px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; line-height: 1.2;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--bg); }
.btn.lg { padding: 14px 26px; font-size: 16px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); } .btn.accent:hover { background: #6d28d9; }

/* ---- フォーム ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(31,111,235,.25); border-color: var(--primary); }

/* ---- カード / パネル ---- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.auth-wrap { max-width: 440px; margin: 48px auto; padding: 0 16px; }
.auth-wrap h1 { font-size: 24px; margin: 0 0 6px; }
.auth-wrap .sub { color: var(--muted); margin: 0 0 22px; font-size: 14.5px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---- バッジ ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.status-open { background: #dbeafe; color: var(--open); }
.badge.status-pending { background: #fef3c7; color: var(--pending); }
.badge.status-closed { background: #d1fae5; color: var(--closed); }
.badge.prio-high { background: #fee2e2; color: var(--high); }
.badge.prio-normal { background: #eef1f5; color: var(--normal); }
.badge.prio-low { background: #f1f5f9; color: var(--low); }

/* ---- 空状態 ---- */
.empty { padding: 44px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty svg { width: 42px; height: 42px; color: #c3cbd6; margin-bottom: 10px; }

/* ---- トースト ---- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ok); color: #fff; padding: 12px 22px; border-radius: 11px; font-size: 14.5px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 200; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--err); }

/* ---- 通信断バナー ---- */
.offline-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: #92400e; color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 9px 16px;
}

/* ---- サンドボックス（体験用）バナー ---- */
.sandbox-banner {
  background: var(--sandbox-bg); color: var(--sandbox); border-bottom: 1px solid #f5d9b8;
  font-size: 13px; padding: 8px 16px; text-align: center; font-weight: 700;
}
.sandbox-banner span { font-weight: 400; color: #92400e; }

/* ---- フッター（共通） ---- */
footer.site {
  background: #0f1720; color: #aab4c0; margin-top: 56px; padding: 40px 20px 28px;
}
footer.site .inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { footer.site .inner { grid-template-columns: 1fr; } }
footer.site h4 { color: #fff; font-size: 13px; margin: 0 0 12px; letter-spacing: .03em; }
footer.site a { color: #aab4c0; font-size: 13.5px; display: block; padding: 3px 0; }
footer.site a:hover { color: #fff; }
footer.site .fbrand { color: #fff; font-weight: 800; font-size: 16px; margin-bottom: 8px; }
footer.site .copy { max-width: 1100px; margin: 26px auto 0; padding-top: 18px; border-top: 1px solid #223; font-size: 12px; color: #7a8695; }

.hidden { display: none !important; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- 汎用ドキュメントページ（terms/privacy/legal/contact/pricing 本文） ---- */
.doc { max-width: 860px; margin: 0 auto; padding: 40px 20px 20px; }
.doc h1 { font-size: 30px; margin: 0 0 6px; }
.doc .lead { color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.doc h2 { font-size: 19px; margin: 30px 0 10px; padding-top: 8px; }
.doc p, .doc li { font-size: 15px; }
.doc table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14.5px; }
.doc th, .doc td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg); }
.doc .note { background: var(--sandbox-bg); border: 1px solid #f5d9b8; color: #92400e; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; }
