/* BYOD サンプル 共通スタイル
   フレームワークは使わない。ビルド工程なし（→ DESIGN.md 5章）
   iOS 16 / Android Chrome 108 を下限として動くものだけを使う */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --accent: #0071e3;
  --border: #d2d2d7;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --surface: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --accent: #2997ff;
    --border: #3a3a3c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Noto Sans JP", sans-serif;
  /* 端末側の文字サイズ変更に追従させる（公開アプリのノウハウ） */
  font-size: 1rem;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1 { font-size: 1.5rem; line-height: 1.35; margin: 0 0 16px; }
h2 { font-size: 1.2rem; line-height: 1.4; margin: 32px 0 12px; }
p  { margin: 0 0 14px; }

.muted { color: var(--text-2); font-size: .9rem; }

a { color: var(--accent); }

button, .btn {
  font: inherit;
  padding: 12px 18px;
  min-height: 44px;           /* 指で押せる最小サイズ */
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 12px;
}

/* ── ヘッダ ── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.site-logo { font-weight: 700; text-decoration: none; color: var(--text); }
.site-user { font-size: .9rem; color: var(--text-2); }

.badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px;
  font-size: .75rem; border-radius: 999px;
  background: var(--accent); color: #fff; vertical-align: middle;
}
.badge.warn { background: #b25000; }

/* ── フォーム ── */
label { display: block; margin: 14px 0 4px; font-size: .875rem; color: var(--text-2); }
input, select {
  font: inherit; width: 100%; padding: 12px;
  min-height: 44px;                     /* 指で押せる最小サイズ */
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
form { margin: 0 0 20px; }
form button { margin-top: 14px; }
button.danger { background: #c62828; }
button:disabled { opacity: .5; }

.status {
  margin: 10px 0; font-size: .9rem; color: var(--text-2); min-height: 1.4em;
  /* 長いエラーメッセージが画面幅を超えないようにする */
  overflow-wrap: anywhere; word-break: break-word;
}
.status.error { color: #c62828; }

/* ── カード ── */
.card-list { margin: 0 0 16px; }
.card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card.suspended { opacity: .55; }
.card-main { min-width: 0; }

/* ── 招待コード ── */
.invite-code {
  margin: 12px 0; padding: 20px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.invite-code .code {
  font-size: 2rem; font-weight: 700; letter-spacing: .12em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
