:root {
  --navy: #585874;
  --blue: #005DA3;
  --red: #FF243E;
  --line: #E2E2E7;
  --snow: #F7F7F7;
  --baby: #E2F3FF;
  --sumi: #16161D;
  --bar: 44px;
  --header: 72px;
  --side: 290px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--navy);
  background: var(--snow);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: #69697F; font-size: 14px; line-height: 1.6; }
.fine { color: #86869B; font-size: 12px; line-height: 1.6; }
.error { color: var(--red); font-size: 13px; min-height: 1.2em; }
h1 { font-size: 24px; margin: 0 0 8px; color: var(--sumi); }
h2 { font-size: 16px; margin: 0 0 8px; color: var(--sumi); }
p { line-height: 1.7; }
a.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.secondary { background: #fff; color: var(--navy); border-color: #d5d5de; }
.btn.danger { background: var(--red); color: #fff; }
.btn.text { background: none; border: 0; color: var(--blue); padding: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

#gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  padding: 32px 28px;
}
.gate-card .brand { font-weight: 700; letter-spacing: 0.04em; margin: 0 0 12px; }
.gate-card label, .field { display: block; font-size: 14px; margin-top: 16px; }
.gate-card input, .field input, .field select, .field textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.gate-card .btn { margin-top: 16px; width: 100%; }

.mockbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-height: var(--bar);
  padding: 6px 16px;
  background: var(--sumi);
  color: #fff;
  font-size: 12px;
}
.mockbar button {
  background: transparent;
  color: #fff;
  border: 1px solid #3a3a48;
  border-radius: 999px;
  padding: 4px 10px;
}
.mockbar button.on { background: #fff; color: var(--sumi); border-color: #fff; }
.map-panel {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px 20px;
}
.map-panel h2 { margin-top: 12px; }
.map-panel button { margin: 4px 6px 0 0; }

.header {
  position: sticky;
  top: var(--bar);
  z-index: 40;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand-lock { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.brand-lock strong { display: block; color: var(--sumi); font-size: 14px; }
.brand-lock span, .who { display: block; font-size: 12px; color: #69697F; }
.nav { display: flex; gap: 4px; height: 100%; align-items: stretch; }
.nav button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 10px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}
.nav button.active { border-bottom-color: var(--blue); font-weight: 700; }
.account { position: relative; }
.account > button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 240px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(22, 22, 29, 0.08);
  padding: 8px;
  z-index: 50;
}
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px; border-radius: 6px; }
.menu button:hover { background: var(--snow); }
.menu-btn { display: none; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }

.sidebar {
  position: fixed;
  top: calc(var(--bar) + var(--header));
  left: 0;
  bottom: 0;
  width: var(--side);
  background: #fff;
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 16px 16px 48px;
  z-index: 30;
}
.sidebar .group { margin: 16px 0 6px; font-size: 12px; color: #86869B; }
.sidebar button.side {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: #4b5563;
}
.sidebar button.side.active { background: #eff6ff; color: #0369a1; font-weight: 700; }
.sidebar button.side:hover { background: #f3f4f6; }
.with-side { margin-left: var(--side); }
.main { padding: 24px 24px 80px; }
.page { max-width: 960px; }
.member-page { max-width: 1040px; margin: 0 auto; }

.card, .stat, .scope-out, .mock-only, .notice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.hero { border-left: 4px solid var(--blue); }
.stat strong { display: block; font-size: 28px; color: var(--sumi); margin-top: 4px; }
.stat span { font-size: 13px; }
.notice { background: #fffbeb; border-color: #fcd34d; }
.scope-out { background: #f8f8f9; border-style: dashed; color: #69697F; }
.scope-tag, .badge {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--snow);
  border: 1px solid var(--line);
}
.badge.ok { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.badge.warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.badge.ng { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.mock-only { border-style: dashed; background: #f8fafc; }
.bar { height: 8px; background: #ececf0; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > span { display: block; height: 100%; background: var(--blue); }
.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--navy);
}
.choice.on { border-color: var(--blue); background: var(--baby); font-weight: 700; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--snow); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 8px 0; }
.chart i {
  display: block;
  flex: 1;
  background: #7EA1BC;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
}
.chart i span {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}
.gift-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--snow);
  padding: 12px;
  border-radius: 6px;
  word-break: break-all;
}
#toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sumi);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 80;
  font-size: 14px;
}
.steps { display: flex; gap: 6px; margin: 8px 0 16px; }
.steps i { width: 28px; height: 6px; border-radius: 99px; background: #e2e2e7; display: block; }
.steps i.on { background: var(--blue); }
@media (max-width: 960px) {
  .mockbar { position: static; }
  .header { top: 0; }
  .sidebar { top: var(--header); }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    height: auto;
    z-index: 45;
    padding: 8px;
  }
  .nav.open button { text-align: left; padding: 10px; border-bottom: 0; }
  .menu-btn { display: inline-flex; }
  .sidebar { transform: translateX(-105%); transition: transform 0.2s ease; }
  .sidebar.open { transform: none; }
  .with-side { margin-left: 0; }
  .who { display: none; }
}
