/* 見た目はポータルと同じ Number Garage の色と形 */
:root { --bg: #f2f2f5; --card: #ffffff; --border: #e6e6ea; --text: #1c1c1e; --body: #48484d; --sub: #7a7a80; --primary: #1c1c1e; --danger: #d92d3a; --danger-bg: #fdecec; --danger-border: #f6c9c6; --ok: #2fa84f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Noto Sans JP', sans-serif; line-height: 1.7; }
main { max-width: 520px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; gap: 16px; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0; font-size: 20px; }
p { margin: 0; }
.lead { color: var(--body); font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.step { font-size: 13px; font-weight: 700; color: var(--sub); }
.box { background: var(--bg); border-radius: 14px; padding: 14px 16px; font-size: 13px; color: var(--body); display: flex; flex-direction: column; gap: 6px; }
.box strong { color: var(--text); }
ul { margin: 0 0 6px; padding-left: 20px; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
dt { color: var(--sub); }
dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; flex-shrink: 0; }
.button { height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 16px; font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; border: none; }
.primary { background: var(--primary); color: #fff; }
.quiet { background: var(--bg); color: var(--body); }
.danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.disabled { opacity: 0.45; pointer-events: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.notice { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 700; }
.notice.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); height: auto; display: block; }
.links { font-size: 13px; text-align: center; }
a { color: var(--primary); }
.doc { font-size: 14px; color: var(--body); gap: 12px; }
.doc h1 { color: var(--text); }
.doc h2 { color: var(--text); font-size: 16px; margin-top: 8px; }

/* 入口：背景の上にロゴと名前、その下にボタン。見本の順に、ロゴのあとで残りが現れる */
.entrance { min-height: 100vh; min-height: 100dvh; background: #0d1b36; }
.entrance::before { content: ''; position: fixed; inset: 0; z-index: -1; background: url(/bg.webp) center / cover no-repeat; }
.entrance main { min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; gap: 20px; padding: 32px 16px; }
.entrance main > * { width: 100%; max-width: 520px; }
.logo { display: block; width: 110px !important; height: auto; filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)); }
.landing .logo { width: min(180px, 42vw) !important; }
.site-title { margin: 0; color: #fff; font-weight: 300; font-size: 26px; text-align: center; letter-spacing: 0.04em; }
.landing .site-title { font-size: clamp(30px, 6vw, 44px); }
#login { max-width: 320px; }
.white { background: #fff; color: var(--text); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.entrance .links { color: #fff; margin: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; font-weight: 300; font-size: 15px; }
.entrance .links a { color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .landing .logo { animation: appear 0.8s ease both; }
  .landing main > :not(.logo) { animation: appear 0.8s ease 0.6s both; }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
}

/* プライバシーポリシーの切り替えと文書の形 */
.doc article { display: flex; flex-direction: column; gap: 12px; }
.fiction { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; font-size: 13px; }
.switch { display: flex; gap: 4px; padding: 4px; background: #efeff2; border-radius: 14px; position: sticky; top: 8px; z-index: 1; }
.switch button { flex: 1; height: 44px; border: none; border-radius: 10px; background: transparent; color: var(--body); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.formal h3 { margin: 12px 0 0; color: var(--text); font-size: 16px; }
.formal h4 { margin: 4px 0 0; color: var(--text); font-size: 14px; }
.kan { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kan li { display: grid; grid-template-columns: 2.6em 1fr; }
.kan li::before { content: attr(data-n); }
.table { overflow-x: auto; }
.table table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 13px; }
.table th, .table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.table th { background: var(--bg); color: var(--text); }

/* 同意の画面：規約の全文を枠の中で読む */
.doc-tabs { position: static; }
.doc-tabs button { padding: 0 4px; font-size: 13px; }
.legal { max-height: 46vh; min-height: 220px; overflow-y: auto; padding: 14px 16px; background: var(--bg); border-radius: 14px; font-size: 13px; color: var(--body); overflow-wrap: anywhere; }
.legal > div { display: flex; flex-direction: column; gap: 10px; }
.legal article { display: flex; flex-direction: column; gap: 10px; }
.legal h1 { font-size: 18px; color: var(--text); }
.legal h2 { font-size: 15px; color: var(--text); margin-top: 6px; }
.legal .switch { position: sticky; top: -14px; }

/* 管理ページ（/manage）：左にロール、右にそのロールの設定 */
.manage main { max-width: 1040px; }
.manage .switch { position: static; }
.field { width: 100%; height: 52px; padding: 0 14px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 14px; font: inherit; font-size: 15px; }
.label { font-size: 13px; font-weight: 700; color: var(--sub); }
.hint { font-size: 13px; color: var(--sub); overflow-wrap: anywhere; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.buttons .button { flex: 1 1 140px; padding: 0 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.xs { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.columns { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.side { padding: 14px; gap: 10px; position: sticky; top: 16px; }
.role-list { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; }
.role-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 6px 12px; width: 100%; border: none; border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.role-row:hover { background: var(--bg); }
.role-row[aria-pressed="true"] { background: var(--primary); color: #fff; }
.role-row.off { color: var(--sub); font-weight: 400; }
.role-row[aria-pressed="true"].off { color: #fff; }
.chip { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; background: #efeff2; color: var(--body); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chip.private { background: var(--danger-bg); color: var(--danger); }
.condition { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bg); border-radius: 14px; }
.tree { display: flex; flex-direction: column; gap: 8px; }
.tree .children { display: flex; flex-direction: column; gap: 8px; padding-left: 28px; }
.tree .check { font-weight: 400; overflow-wrap: anywhere; }
.tree .check.parent { font-weight: 700; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.head h2 { overflow-wrap: anywhere; min-width: 0; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.side .tools .button { flex: 1; }
.link { align-self: flex-start; padding: 0; border: none; background: none; color: var(--danger); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.affix { display: flex; flex-wrap: wrap; gap: 10px; }
.affix .field { flex: 1 1 180px; width: auto; }
.group-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.group-row > .tree { flex: 1 1 260px; min-width: 0; }
.group-side { flex: 0 0 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.group-side .link { align-self: center; }
.group-icon { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
@media (max-width: 760px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .role-list { max-height: 40vh; }
}
