:root {
  --color-bg: #f4f5f9;
  --color-surface: #ffffff;
  --color-border: #e5e7eb;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-primary: #dc2626;
  --color-primary-dark: #b91c1c;
  --color-accent: #2563eb;
  --color-gold: #d97706;
  --color-ok: #16a34a;
  --color-ok-bg: #dcfce7;
  --color-warn: #d97706;
  --color-warn-bg: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  --nav-height: 62px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 10px);
}

a { color: var(--color-accent); text-decoration: none; }

.app-header {
  background:
    radial-gradient(circle at 18% -140%, rgba(255, 100, 72, 0.48), transparent 58%),
    linear-gradient(118deg, #101827 0%, #182338 58%, #223047 100%);
  color: #fff;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.app-header .header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-header .header-inner #account-link {
  margin-left: auto;
  min-width: 44px;
  justify-content: center;
  padding-left: 7px;
  padding-right: 7px;
}

.app-title {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
  animation: brand-arrive 420ms cubic-bezier(.2, .75, .3, 1) both;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 12px rgba(5, 10, 22, 0.24));
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.brand-name {
  font-family: "Avenir Next", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

.brand-tagline {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-family: "Avenir Next Condensed", "DIN Condensed", sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.brand-context {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 8px;
  letter-spacing: 0.12em;
  vertical-align: 2px;
}

@keyframes brand-arrive {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.header-link {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.92;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .app-title { animation: none; }
}

@media (max-width: 360px) {
  .app-title { gap: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 13px; }
  .brand-tagline { display: none; }
}

@media (max-width: 480px) {
  .app-header .brand-mark { width: 32px; height: 32px; }
  .app-header .brand-name { font-size: 12px; letter-spacing: .015em; }
  .app-header .brand-tagline { display: none; }
  .app-header .header-link { min-width: 40px; padding-left: 7px; padding-right: 7px; font-size: 10px; }
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px;
}

h1, h2, h3 { margin-top: 0; }
h1 { font-size: 19px; }
h2 { font-size: 16px; }

.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ヘッダー行・操作ボタン行の共通レイアウト(justify-content/align-itemsはインラインstyleで
   ページごとに指定される。display:flexが無いとそれらのプロパティが効かないため必須)。
   幅の狭い画面でボタンがはみ出さないよう折り返しも許可する。 */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- モーダル(管理画面の更新候補詳細等) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 16px 8px calc(16px + env(safe-area-inset-bottom));
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  padding: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 100%;
  overflow-y: auto;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

/* ---- 今日やることサマリー ---- */
.today-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.monitoring-status-card {
  background: linear-gradient(135deg, #f7fbff, #fff);
  border: 1px solid #d7e7f5;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.monitoring-status-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.monitoring-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.monitoring-status-grid > div {
  background: #fff;
  border: 1px solid #e7eef4;
  border-radius: 10px;
  padding: 9px;
}

.monitoring-status-grid span,
.monitoring-status-grid strong {
  display: block;
}

.monitoring-status-grid span { color: var(--color-text-muted); font-size: 11px; }
.monitoring-status-grid strong { margin-top: 2px; font-size: 15px; }

@media (max-width: 520px) {
  .monitoring-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.today-tile {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}

.today-tile .today-count {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-primary);
}

.today-tile .today-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-top: 2px;
}

/* ---- 横スクロールカードリスト ---- */
.card-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.card-scroll::-webkit-scrollbar { height: 4px; }

/* ---- 商品/抽選カード ---- */
.item-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex: 0 0 250px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.item-card.full-width {
  flex: 1 1 100%;
  width: 100%;
}

.item-card-image {
  width: 100%;
  height: clamp(140px, 24vw, 180px);
  min-height: 140px;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.item-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.market-quote {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
}

.market-quote.compact { padding: 8px; }
.market-price-value { color: var(--color-primary); font-size: 16px; }

.item-card-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.item-card-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  align-items: flex-start;
  min-width: 0;
}

.price-row .price-label { color: var(--color-text-muted); flex-shrink: 0; max-width: 40%; }
.price-row .price-value { font-weight: 700; overflow-wrap: anywhere; text-align: right; min-width: 0; word-break: break-word; }
.price-value.profit-plus { color: var(--color-ok); }
.price-value.profit-minus { color: var(--color-danger); }

.item-card a,
.item-card-body a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 768px) {
  .item-card {
    flex-basis: min(100%, 280px);
  }

  .item-card-image {
    height: clamp(120px, 30vw, 170px);
    min-height: 120px;
    padding: 10px;
  }

  .item-card-body {
    padding: 10px;
  }

  .price-row {
    font-size: 12px;
    gap: 6px;
  }
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.badge.ok { background: var(--color-ok-bg); color: var(--color-ok); }
.badge.warn { background: var(--color-warn-bg); color: var(--color-warn); }
.badge.danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge.neutral { background: #eef2ff; color: var(--color-accent); }
.badge.urgent-reason { background: #1f2937; color: #fff; }
/* Phase25: システムが人間を介さず自動発見した情報であることを示すバッジ */
.badge.new-badge { background: #fef3c7; color: #92400e; }

/* Phase8: ホーム最上部「今すぐ応募できる抽選」カード */
.apply-now-card { border-left: 4px solid var(--color-primary); margin-bottom: 10px; }

.countdown {
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--color-text);
  text-align: center;
}
.countdown.urgent {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  animation: pulse 1.6s infinite;
}
/* Phase17: 締切3時間未満(critical)は、24時間未満(urgent)よりさらに強い警告色にする */
.countdown.critical {
  background: var(--color-danger);
  color: #fff;
  animation: pulse 1s infinite;
}
.countdown.closed {
  background: #e5e7eb;
  color: var(--color-text-muted);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.stars { color: var(--color-gold); letter-spacing: 1px; font-size: 14px; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 18px;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  background: var(--color-primary);
  color: #fff;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--color-primary-dark); }
.btn:disabled { background: #9ca3af; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn.accent { background: var(--color-accent); }
.btn.danger { background: var(--color-danger); }
.btn.small { padding: 8px 14px; min-height: 44px; font-size: 13px; }
.btn.block { width: 100%; }

/* ---- カード(通常) ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  min-height: 44px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-message { padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.form-message.error { color: var(--color-danger); background: var(--color-danger-bg); }
.success-message { color: var(--color-ok) !important; background: var(--color-ok-bg); padding: 10px 12px; border-radius: 8px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.checkbox-row input { width: auto; }

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 10px;
}
.checkbox-grid .checkbox-row { font-size: 12px; }

.rule-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
}
.rule-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.rule-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rule-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-surface-alt, #f0f0f0);
  color: var(--color-text-muted);
}

/* ---- 下部固定ナビゲーション ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.06);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px;
  min-height: var(--nav-height);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.bottom-nav a .nav-icon { font-size: 20px; }
.bottom-nav a.active { color: var(--color-primary); }

/* ---- 検索・フィルター ---- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow-x: visible;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.filter-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 40px 16px;
  font-size: 14px;
}

.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2933;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th, table.data-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
table.data-table th { color: var(--color-text-muted); font-size: 12px; }

.tab-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}
.tab-row button {
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tab-row button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- 管理者ログイン専用の見た目 ---- */
.admin-login-body { background: #111827; min-height: 100vh; }
.admin-login-card { border-top: 5px solid #f59e0b; background: #1f2937; color: #f3f4f6; }
.admin-login-card label { color: #cbd5e1; }
.admin-login-card input { background: #111827; border-color: #374151; color: #f3f4f6; }
.admin-login-badge {
  display: inline-block;
  background: #f59e0b;
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

@media (min-width: 720px) {
  .today-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---- Phase3: 信頼度・鮮度バッジ ---- */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.trust-badge.official_confirmed { background: #dbeafe; color: #1d4ed8; }
.trust-badge.store_official { background: #e0e7ff; color: #4338ca; }
.trust-badge.admin_confirmed { background: var(--color-ok-bg); color: var(--color-ok); }
.trust-badge.unconfirmed { background: #f3f4f6; color: var(--color-text-muted); }
.trust-badge.conflicting { background: var(--color-danger-bg); color: var(--color-danger); }
.trust-badge.expired { background: #e5e7eb; color: #4b5563; }

.freshness-note {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.freshness-note.stale { color: var(--color-danger); font-weight: 700; }

/* ---- Phase3: 優先度フィード(緊急/今日/近日) ---- */
.priority-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
  border-left: 5px solid transparent;
}
.priority-item.urgent { border-left-color: var(--color-danger); }
.priority-item.today { border-left-color: var(--color-gold); }
.priority-item.soon { border-left-color: var(--color-ok); }

.priority-icon { font-size: 18px; line-height: 1.4; }

.priority-item-body { flex: 1; min-width: 0; }
.priority-item-time {
  font-size: 12px;
  font-weight: 800;
}
.priority-item.urgent .priority-item-time { color: var(--color-danger); }
.priority-item.today .priority-item-time { color: var(--color-gold); }
.priority-item.soon .priority-item-time { color: var(--color-ok); }

.priority-item-title { font-size: 14px; font-weight: 800; margin-top: 2px; }
.priority-item-sub { font-size: 12px; color: var(--color-text-muted); }

/* ---- Phase3: カレンダー ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day-label {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 700;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  cursor: pointer;
  position: relative;
}
.calendar-day.empty { background: none; cursor: default; }
.calendar-day.today { background: #fee2e2; font-weight: 800; color: var(--color-danger); }
.calendar-day.selected { outline: 2px solid var(--color-primary); }
.calendar-day .cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  margin-top: 2px;
}

/* ---- 更新候補・監査ログのJSON/理由表示ボックス ---- */
.reply-box {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 100%;
  overflow-x: auto;
}
.reason-box {
  border-radius: 8px;
  padding: 8px 10px;
  overflow-wrap: anywhere;
}

/* ---- Phase3: 差分表示 ---- */
.diff-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.diff-table td { padding: 4px 6px; border-bottom: 1px solid var(--color-border); }
.diff-before { color: var(--color-danger); text-decoration: line-through; }
.diff-after { color: var(--color-ok); font-weight: 700; }

/* ---- Phase5: 「次にすべきこと」行動バナー ---- */
.action-status {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}
.action-status.urgent { background: var(--color-danger-bg); border-color: var(--color-danger); }
.action-status.positive { background: var(--color-ok-bg); border-color: var(--color-ok); }
.action-status-headline { font-weight: 800; font-size: 14px; }
.action-status.urgent .action-status-headline { color: var(--color-danger); }
.action-status.positive .action-status-headline { color: var(--color-ok); }
.action-status-detail { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.action-status .btn { margin-top: 8px; }

/* ---- Phase5: 通知ベル ---- */
.notif-bell-wrap { position: relative; display: inline-flex; align-items: center; margin-right: 10px; }
.notif-bell-btn {
  background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1;
  color: #fff; padding: 4px; min-width: 44px; min-height: 44px;
}
.notif-bell-badge {
  position: absolute; top: -2px; right: -2px; background: var(--color-danger); color: #fff;
  font-size: 10px; font-weight: 800; border-radius: 999px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-panel {
  position: absolute; top: 100%; right: 0; margin-top: 6px; width: 320px; max-width: min(320px, calc(100vw - 16px));
  max-height: 420px; overflow-y: auto; overflow-x: hidden; background: #fff; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); z-index: 50; padding: 8px; display: none;
  box-sizing: border-box;
}
.notif-panel.open { display: block; }
.notif-item { padding: 10px; border-radius: 8px; font-size: 13px; color: var(--color-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.notif-item.unread { background: #eef2ff; font-weight: 700; }
.notif-item-time { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; font-weight: 400; }

/* スマートフォン幅では、ベルの位置に関係なく画面左右に8pxの余白で確実に収める
   (position:absolute; right:0 のままだと、ベルが画面端に無い場合に左右がはみ出すため、
   幅の狭い画面ではposition:fixedへ切り替えてビューポート基準で配置する)。 */
@media (max-width: 480px) {
  .app-header { padding-left: 10px; padding-right: 10px; }
  .app-header .header-inner { gap: 2px; }
  .notif-bell-wrap { margin-right: 0; }
  .notif-panel {
    position: fixed;
    top: 64px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    margin-top: 0;
    max-height: calc(100vh - 64px - var(--nav-height) - env(safe-area-inset-bottom) - 16px);
  }
}
.watch-btn { margin-top: 8px; }

/* ---- 月額サービスの利用状況 ---- */
.subscription-page { max-width: 640px; margin-left: auto; margin-right: auto; }
.subscription-page-heading { margin: 8px 0 22px; }
.subscription-page-heading > span,
.subscription-card-kicker { color: #9b6720; font-family: "Avenir Next", sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.subscription-page-heading h1 { margin: 4px 0 2px; font-size: 25px; }
.subscription-page-heading p { margin: 0; color: var(--color-text-muted); font-size: 12px; }
.subscription-next-action { display: grid; gap: 10px; margin: 0 0 16px; padding: 22px; border-radius: 16px; background: linear-gradient(135deg, #0f1c2d, #19324c); color: #fff; box-shadow: 0 12px 30px rgba(15,28,45,.18); }
.subscription-next-action > span { color: #f3b75d; font-family: "Avenir Next", sans-serif; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.subscription-next-action h2 { margin: 0; font-size: 21px; line-height: 1.35; }
.subscription-next-action p { margin: 0; color: rgba(255,255,255,.76); font-size: 13px; }
.subscription-next-action small { color: rgba(255,255,255,.62); font-size: 10px; text-align: center; }
.subscription-primary-cta { border-color: #f1a22e; background: #f1a22e; color: #172437; font-size: 15px; }
.subscription-primary-cta:hover { background: #ffb13c; }
.subscription-flow { margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid #dce1e7; border-radius: 12px; background: #fff; list-style: none; }
.subscription-flow li { min-width: 0; display: flex; gap: 8px; align-items: center; padding: 12px 9px; border-right: 1px solid #e1e5e9; color: #7b8695; }
.subscription-flow li:last-child { border-right: 0; }
.subscription-flow li > span { flex: 0 0 auto; display: flex; width: 24px; height: 24px; align-items: center; justify-content: center; border: 1px solid #cbd2db; border-radius: 50%; font-size: 10px; font-weight: 800; }
.subscription-flow li div { min-width: 0; display: grid; }
.subscription-flow li strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.subscription-flow li small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.subscription-flow li:first-child,
.subscription-flow li.complete { color: #1e6048; background: #f3faf7; }
.subscription-flow li:first-child > span,
.subscription-flow li.complete > span { border-color: #2a7458; background: #2a7458; color: #fff; }
.subscription-flow li.current { color: #79541d; background: #fffbf4; box-shadow: inset 0 -3px #dda24c; }
.subscription-status-card { display: grid; gap: 12px; }
.subscription-status-card [hidden] { display: none !important; }
.subscription-status-card h2,
.subscription-status-card p { margin: 0; }
.subscription-plan { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-bottom: 12px; border-bottom: 1px solid var(--color-border); }
.subscription-plan > span { color: var(--color-text-muted); font-size: 12px; }
.subscription-plan strong { color: #172437; font-size: 17px; }
.subscription-plan small { color: var(--color-text-muted); font-size: 9px; }
.subscription-state-line { display: flex; align-items: center; gap: 12px; }
.subscription-state-line > span { width: 12px; height: 12px; border-radius: 50%; background: #9aa3af; box-shadow: 0 0 0 5px #f0f2f4; }
.subscription-state-line > span.active { background: #25805d; box-shadow: 0 0 0 5px #e1f1eb; }
.subscription-state-line > span.inactive { background: #c98a31; box-shadow: 0 0 0 5px #fbefd9; }
.subscription-state-line div { display: grid; }
.subscription-state-line small { color: var(--color-text-muted); font-size: 9px; }
.subscription-state-line h2 { margin: 0; }
.subscription-summary { display: grid; gap: 5px; padding: 12px; margin-bottom: 12px; background: #f8fafc; border-radius: 10px; }
.subscription-summary span { color: var(--color-text-muted); font-size: 13px; }
.subscription-summary.error { color: var(--color-danger); }
.subscription-details { margin: 0; }
.subscription-details > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--color-border); }
.subscription-details dt { color: var(--color-text-muted); }
.subscription-details dd { margin: 0; font-weight: 700; text-align: right; }
.subscription-prerequisite,
.payment-safety-note { display: grid; gap: 3px; margin: 12px 0; padding: 13px; border-radius: 9px; background: #f7f8fa; }
.subscription-prerequisite strong,
.payment-safety-note strong { font-size: 12px; }
.subscription-prerequisite span,
.payment-safety-note span { color: var(--color-text-muted); font-size: 10px; }
.subscription-prerequisite { border-left: 3px solid #d79b43; }
.subscription-prerequisite[hidden] { display: none; }
.payment-safety-note { border-left: 3px solid #2d7158; }
.subscription-checkout-lead { margin: -4px 0 12px; color: var(--color-text-muted); font-size: 12px; }
.subscription-payment-button { display: grid; gap: 1px; min-height: 58px; }
.subscription-payment-button strong { font-size: 14px; }
.subscription-payment-button small { color: rgba(255,255,255,.75); font-size: 10px; }
.subscription-unavailable { display: grid; gap: 7px; padding: 16px; border: 1px solid #e8c17f; border-radius: 11px; background: #fff9ed; color: #60491f; text-align: left; }
.subscription-unavailable strong { font-size: 14px; }
.subscription-unavailable span { color: #78623b; font-size: 12px; }
.subscription-unavailable .btn { margin-top: 5px; }
.subscription-after-payment h2 { margin: 5px 0 14px; }
.subscription-benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.subscription-benefits > div { display: grid; gap: 2px; padding: 12px; border: 1px solid #e0e4e9; border-radius: 9px; background: #fafbfc; }
.subscription-benefits strong { font-size: 11px; }
.subscription-benefits span { color: var(--color-text-muted); font-size: 9px; }

@media (max-width: 520px) {
  .subscription-page-heading { margin-bottom: 14px; }
  .subscription-page-heading h1 { font-size: 23px; }
  .subscription-next-action { padding: 20px 17px; }
  .subscription-flow { grid-template-columns: 1fr; }
  .subscription-flow li { min-height: 57px; padding: 10px 13px; border-right: 0; border-top: 1px solid #e1e5e9; }
  .subscription-flow li:first-child { border-top: 0; }
  .subscription-flow li strong,
  .subscription-flow li small { overflow: visible; text-overflow: clip; white-space: normal; }
  .subscription-flow li strong { font-size: 12px; }
  .subscription-flow li small { font-size: 10px; }
}

.onboarding-choice-card { border: 1px solid #c8d3df; box-shadow: 0 12px 30px rgba(15,28,45,.09); }
.onboarding-choice-card h2 { margin: 4px 0 5px; font-size: 22px; }
.onboarding-choice-card > p { color: var(--color-text-muted); font-size: 13px; }
.onboarding-game-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 17px 0 12px; }
.onboarding-game-choice { position: relative; display: grid; min-height: 94px; align-content: center; gap: 3px; padding: 13px 7px 10px; border: 1px solid #cfd6df; border-radius: 11px; background: #fff; color: #172437; cursor: pointer; }
.onboarding-game-choice strong { font-size: 14px; }
.onboarding-game-choice span { color: var(--color-text-muted); font-size: 9px; line-height: 1.45; }
.onboarding-game-choice em { position: absolute; top: -8px; left: 50%; padding: 2px 7px; border-radius: 999px; background: #d9902d; color: #fff; font-size: 8px; font-style: normal; font-weight: 800; transform: translateX(-50%); white-space: nowrap; }
.onboarding-game-choice.recommended { border-color: #d9902d; background: #fffaf2; }
.onboarding-game-choice.selected { border-color: #247252; background: #edf8f3; box-shadow: inset 0 0 0 1px #247252; }
.onboarding-game-choice:disabled { cursor: wait; opacity: .65; }
.onboarding-billing-note { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: #f5f7f9; color: #566273 !important; font-size: 11px !important; }
.onboarding-advanced-link { display: block; margin-top: 13px; color: #536477; font-size: 11px; font-weight: 700; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.onboarding-mode main > h1,
.onboarding-mode #ns-inapp-card,
.onboarding-mode #ns-line-card,
.onboarding-mode #ns-event-types-card,
.onboarding-mode #ns-stores-card,
.onboarding-mode #ns-rules-card,
.onboarding-mode .bottom-nav { display: none; }
.onboarding-mode { padding-bottom: 20px; }
.onboarding-mode main { max-width: 560px; padding-top: 24px; }

/* ---- 一般ユーザー向けLINE通知設定 ---- */
.line-status-panel {
  display: grid;
  gap: 6px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #f8fafc;
}
.line-status-panel > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.line-status-panel p { margin: 0; color: var(--color-text-muted); font-size: 13px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.status-badge.status-success { background: var(--color-ok-bg); color: var(--color-ok); }
.status-badge.status-warning { background: #fef3c7; color: #92400e; }
.status-badge.status-muted { background: #e5e7eb; color: #4b5563; }
.status-badge.status-danger { background: var(--color-danger-bg, #fde2e2); color: var(--color-danger, #b91c1c); }
.line-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-height: 48px;
}
.line-toggle-row span { display: grid; gap: 3px; }
.line-toggle-row small { color: var(--color-text-muted); font-size: 12px; }
.line-toggle-row input { width: 24px; height: 24px; flex: 0 0 auto; }
.line-scope-row { margin: 4px 0 12px; }
.line-status-detail { margin: 0 0 12px; font-size: 12px; color: var(--color-text-muted); }
.line-connect-steps { margin: 0 0 14px; padding-left: 22px; color: var(--color-text-muted); font-size: 13px; }
.line-connect-steps li + li { margin-top: 5px; }
.line-connect-note {
  margin: -5px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}
.line-subscription-lock {
  margin: 12px 0;
  padding: 18px;
  border: 1px solid #d8c49f;
  border-radius: 12px;
  background: #fffbf3;
}
.line-subscription-lock > strong { display: block; color: #654b1f; }
.line-subscription-lock ol { margin: 12px 0 16px; padding-left: 22px; color: var(--color-text-muted); font-size: 13px; }
.line-subscription-lock li + li { margin-top: 5px; }
.line-primary-action { width: 100%; justify-content: center; min-height: 48px; }
#ns-line-add-friend-link,
#ns-line-unlink-btn,
#ns-line-copy-btn { margin-top: 10px; min-height: 44px; }
.line-pending p { margin: 5px 0 0; font-size: 12px; }
.line-account-link-page { max-width: 440px; margin: 48px auto; padding: 0 16px; }
.line-account-link-page h1 { text-align: center; font-size: 22px; }
.line-account-link-page p { color: var(--color-text-muted); font-size: 13px; line-height: 1.7; }

@media (max-width: 480px) {
  .line-status-panel { padding: 12px; }
  .line-primary-action,
  #ns-line-add-friend-link,
  #ns-line-unlink-btn,
  #ns-line-copy-btn { width: 100%; justify-content: center; }
}

/* ---- Marketing / subscriber experience 2026 ---- */
.marketing-body {
  --marketing-ink: #101c2c;
  --marketing-navy: #0b1728;
  --marketing-blue: #1c4b72;
  --marketing-amber: #f0a236;
  --marketing-cream: #f7f4ee;
  --marketing-line: #d9dee6;
  background: #fff;
  color: var(--marketing-ink);
  padding-bottom: 0;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

.marketing-body a { color: inherit; }
.marketing-container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.marketing-container.narrow { width: min(760px, calc(100% - 40px)); }
.marketing-main { max-width: none; margin: 0; padding: 0; }

.marketing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(16, 28, 44, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}
.marketing-header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.marketing-logo { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .02em; }
.marketing-logo img { width: 36px; height: 36px; }
.marketing-nav { display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 700; }
.marketing-nav a:not(.marketing-nav-login):hover { color: var(--marketing-blue); }
.marketing-nav-login { display: inline-flex; min-height: 44px; align-items: center; padding: 10px 17px; border: 1px solid var(--marketing-ink); border-radius: 999px; }

.marketing-hero {
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 83% 30%, rgba(52, 115, 164, .42), transparent 26%),
    radial-gradient(circle at 66% 110%, rgba(240, 162, 54, .2), transparent 29%),
    linear-gradient(128deg, #081321 0%, #11263a 62%, #0a1b2d 100%);
}
.marketing-hero-grid { min-height: 680px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 84px; align-items: center; padding: 78px 0; }
.marketing-eyebrow { margin: 0 0 15px; color: #b47625; font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.marketing-hero .marketing-eyebrow,
.marketing-section-dark .marketing-eyebrow { color: #f1b45c; }
.marketing-hero h1 { margin: 0; font-size: clamp(38px, 5.2vw, 68px); line-height: 1.15; letter-spacing: -.04em; }
.marketing-lead { max-width: 590px; margin: 25px 0 0; color: rgba(255,255,255,.76); font-size: 18px; line-height: 1.9; }
.marketing-price-line { display: flex; align-items: baseline; gap: 12px; margin-top: 34px; }
.marketing-price-line strong { font-size: 24px; letter-spacing: .01em; }
.marketing-price-line span { color: rgba(255,255,255,.58); font-size: 12px; }
.marketing-availability { min-height: 24px; margin: 8px 0 0; color: #f4d6a8; font-size: 12px; }
.marketing-hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 24px; }
.marketing-btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 12px 23px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.marketing-btn.primary { background: var(--marketing-amber); color: #1a2230; box-shadow: 0 12px 28px rgba(240,162,54,.18); }
.marketing-btn.primary:hover { background: #f5b04b; }
.marketing-btn.ghost { border-color: #b8c0cb; background: transparent; color: inherit; }
.marketing-btn.block { width: 100%; }
.marketing-text-link { border-bottom: 1px solid rgba(255,255,255,.4); padding: 7px 0; font-size: 13px; font-weight: 700; }
.marketing-microcopy { margin: 16px 0 0; color: rgba(255,255,255,.48); font-size: 11px; }

.notification-phone { width: min(100%, 390px); margin: 0 auto; padding: 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 30px; background: rgba(255,255,255,.08); box-shadow: 0 35px 90px rgba(0,0,0,.28); transform: rotate(1.5deg); }
.notification-phone-bar { display: flex; justify-content: space-between; padding: 2px 8px 14px; color: rgba(255,255,255,.55); font-size: 10px; }
.notification-phone-title { display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 16px 16px 0 0; background: #f1f3f5; color: var(--marketing-ink); }
.notification-phone-title img { width: 36px; height: 36px; }
.notification-phone-title div { display: grid; }
.notification-phone-title strong { font-size: 13px; }
.notification-phone-title small { color: #738092; font-size: 10px; }
.line-notification-sample { padding: 22px; border-radius: 0 0 16px 16px; background: #fff; color: var(--marketing-ink); }
.line-notification-sample .sample-kicker { display: inline-block; color: #9b2c2c; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.line-notification-sample h2 { margin: 8px 0 18px; font-size: 19px; line-height: 1.45; }
.line-notification-sample dl { margin: 0; border-top: 1px solid #e3e7ec; }
.line-notification-sample dl div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e3e7ec; font-size: 12px; }
.line-notification-sample dt { color: #718095; }
.line-notification-sample dd { margin: 0; font-weight: 700; }
.line-notification-sample .sample-action { display: block; margin-top: 18px; padding: 11px; border-radius: 6px; background: #101c2c; color: #fff; text-align: center; font-size: 12px; font-weight: 800; }
.line-notification-sample > small { display: block; margin-top: 10px; color: #8a94a2; font-size: 9px; text-align: right; }

.marketing-proof { border-bottom: 1px solid var(--marketing-line); background: #fff; }
.marketing-proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.marketing-proof-grid > div { display: grid; gap: 2px; padding: 27px 24px; border-left: 1px solid var(--marketing-line); }
.marketing-proof-grid > div:last-child { border-right: 1px solid var(--marketing-line); }
.marketing-proof-grid strong { font-size: 14px; }
.marketing-proof-grid span { color: #6b7787; font-size: 11px; }

.marketing-section { padding: 100px 0; }
.marketing-section-tint { background: var(--marketing-cream); }
.marketing-section-dark { background: var(--marketing-navy); color: #fff; }
.marketing-section-heading { max-width: 690px; margin-bottom: 44px; }
.marketing-section-heading h2,
.pricing-layout h2,
.value-layout h2,
.contact-card h2 { margin: 0; font-size: clamp(28px, 3.5vw, 42px); line-height: 1.3; letter-spacing: -.03em; }
.marketing-section-heading > p:last-child,
.marketing-body-copy,
.contact-card p,
.value-layout p { color: #677386; font-size: 15px; line-height: 1.9; }
.marketing-section-dark .value-layout p { color: rgba(255,255,255,.67); }

.guided-demo { border: 1px solid var(--marketing-line); background: #fff; box-shadow: 0 28px 65px rgba(15,27,44,.08); }
.guided-demo-controls { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--marketing-line); }
.guided-demo-controls button { min-height: 62px; border: 0; border-right: 1px solid var(--marketing-line); background: #f8f9fb; color: #778295; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.guided-demo-controls button:last-child { border-right: 0; }
.guided-demo-controls button.active { background: #fff; color: var(--marketing-ink); box-shadow: inset 0 -3px var(--marketing-amber); }
.guided-demo-stage { min-height: 260px; display: grid; align-items: center; padding: 50px; background: linear-gradient(135deg, #fff 0%, #f7f8fa 100%); }
.guided-demo-panel { display: none; max-width: 720px; grid-template-columns: 120px 1fr; gap: 34px; align-items: center; margin: 0 auto; }
.guided-demo-panel.active { display: grid; }
.demo-number { color: #e4e8ed; font-family: Georgia, serif; font-size: 82px; line-height: 1; }
.guided-demo-panel strong { font-size: 26px; }
.guided-demo-panel p { margin: 12px 0 0; color: #687587; }
.guided-demo > .marketing-btn { display: flex; width: fit-content; margin: 0 auto 34px; }

.onboarding-steps { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; counter-reset: none; }
.onboarding-steps li { position: relative; min-height: 220px; padding: 24px 24px 28px; border-top: 1px solid #cfd5dc; border-bottom: 1px solid #cfd5dc; border-left: 1px solid #cfd5dc; background: rgba(255,255,255,.55); }
.onboarding-steps li:last-child { border-right: 1px solid #cfd5dc; }
.onboarding-steps li > span { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; margin-bottom: 34px; border-radius: 50%; background: var(--marketing-ink); color: #fff; font-weight: 800; }
.onboarding-steps strong { font-size: 15px; }
.onboarding-steps p { margin: 10px 0 0; color: #6d7888; font-size: 12px; }
.marketing-center { margin-top: 34px; text-align: center; }

.pricing-layout { display: grid; grid-template-columns: 1fr 430px; gap: 100px; align-items: center; }
.marketing-check-list { margin: 28px 0 0; padding: 0; list-style: none; }
.marketing-check-list li { padding: 12px 0 12px 28px; border-bottom: 1px solid #e2e5e9; font-size: 13px; }
.marketing-check-list li::before { content: "✓"; float: left; margin-left: -27px; color: #297457; font-weight: 900; }
.pricing-card { padding: 36px; border: 1px solid #cfd5dd; background: #fff; box-shadow: 0 28px 60px rgba(15,27,44,.1); }
.pricing-card > p { margin: 0; color: #687587; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.pricing-card > div:nth-of-type(1) { display: flex; align-items: baseline; gap: 7px; margin-top: 7px; }
.pricing-card > div:nth-of-type(1) strong { font-family: Georgia, serif; font-size: 52px; }
.pricing-card > div:nth-of-type(1) span { font-size: 14px; font-weight: 700; }
.pricing-card > small { color: #758195; font-size: 10px; }
.payment-methods { margin: 24px 0; border-top: 1px solid #e0e4e8; }
.payment-methods > div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #e0e4e8; font-size: 12px; }
.payment-methods strong { color: #8993a1; }
.payment-methods .available strong { color: #23704f; }
#service-payment-note { display: block; margin-top: 12px; line-height: 1.6; }

.value-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 90px; align-items: center; }
.profit-formula { display: grid; grid-template-columns: repeat(7, auto); gap: 9px; align-items: center; padding: 38px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); }
.profit-formula span { padding: 10px; border-radius: 4px; background: rgba(255,255,255,.08); font-size: 12px; text-align: center; }
.profit-formula b { color: rgba(255,255,255,.38); }
.profit-formula strong { color: #f3b557; font-size: 14px; }
.profit-formula small { grid-column: 1 / -1; margin-top: 20px; color: rgba(255,255,255,.5); line-height: 1.7; }

.member-preview { display: grid; grid-template-columns: 210px 1fr; overflow: hidden; border: 1px solid var(--marketing-line); background: #f7f8fa; box-shadow: 0 28px 65px rgba(15,27,44,.08); }
.member-preview aside { padding: 34px 26px; background: #101c2c; color: #fff; }
.member-preview aside strong,
.member-preview aside span { display: block; }
.member-preview aside span { margin-top: 9px; color: rgba(255,255,255,.54); font-size: 11px; }
.member-preview-main { padding: 34px; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-metrics > div { padding: 16px; border: 1px solid #dfe3e8; background: #fff; }
.preview-metrics span,
.preview-metrics strong { display: block; }
.preview-metrics span { color: #707c8c; font-size: 11px; }
.preview-metrics strong { margin-top: 4px; font-family: Georgia, serif; font-size: 28px; }
.preview-feed { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 14px; background: #fff; border: 1px solid #dfe3e8; }
.preview-feed div { display: grid; }
.preview-feed small { color: #7b8695; }
.preview-status { flex: 0 0 auto; padding: 5px 8px; border-radius: 3px; font-size: 10px; font-weight: 800; }
.preview-status.open { background: #dcefe7; color: #1f664c; }
.preview-status.soon { background: #eee8dc; color: #755b27; }
.preview-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.preview-links span { padding: 10px; background: #e8ebef; font-size: 10px; font-weight: 700; text-align: center; }

.marketing-section details { border-top: 1px solid #ccd2da; }
.marketing-section details:last-child { border-bottom: 1px solid #ccd2da; }
.marketing-section summary { padding: 22px 4px; cursor: pointer; font-size: 14px; font-weight: 800; }
.marketing-section details p { margin: 0; padding: 0 4px 22px; color: #667386; font-size: 13px; }
.contact-section { padding-top: 64px; padding-bottom: 64px; }
.contact-card { display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: center; padding: 52px; background: #eef1f4; }
.contact-actions { display: grid; gap: 10px; min-width: 220px; }
.marketing-footer { border-top: 1px solid #dce0e5; padding: 28px 0; background: #fff; color: #687386; font-size: 11px; }
.marketing-footer .marketing-container { display: flex; justify-content: space-between; gap: 24px; }
.marketing-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }

/* Missing images are explained without exposing broken browser icons or unlicensed art. */
.product-image-placeholder {
  display: grid;
  min-height: 96px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dce2e8;
  border-radius: 10px;
  background:
    linear-gradient(135deg, transparent 42%, rgba(33, 67, 96, .05) 42%, rgba(33, 67, 96, .05) 58%, transparent 58%),
    #f4f6f8;
  color: #718094;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.product-image-placeholder::before { content: "CARD"; display: block; color: #b6bec8; font-family: Georgia, serif; font-size: 22px; letter-spacing: .12em; }

@media (max-width: 820px) {
  .marketing-nav a:not(.marketing-nav-login) { display: none; }
  .marketing-hero-grid { grid-template-columns: 1fr; gap: 52px; padding: 58px 0 72px; }
  .notification-phone { width: min(100%, 360px); transform: none; }
  .marketing-proof-grid { grid-template-columns: repeat(2, 1fr); }
  .marketing-proof-grid > div:nth-child(2) { border-right: 1px solid var(--marketing-line); }
  .marketing-proof-grid > div:nth-child(n+3) { border-top: 1px solid var(--marketing-line); }
  .onboarding-steps { grid-template-columns: repeat(2, 1fr); }
  .onboarding-steps li:nth-child(2) { border-right: 1px solid #cfd5dc; }
  .onboarding-steps li:nth-child(n+3) { border-top: 0; }
  .pricing-layout,
  .value-layout { grid-template-columns: 1fr; gap: 48px; }
  .member-preview { grid-template-columns: 1fr; }
  .member-preview aside { padding: 24px; }
  .contact-card { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 560px) {
  .marketing-container,
  .marketing-container.narrow,
  .marketing-header-inner { width: min(100% - 28px, 1120px); }
  .marketing-header-inner { min-height: 62px; }
  .marketing-logo { gap: 8px; font-size: 13px; }
  .marketing-logo img { width: 32px; height: 32px; }
  .marketing-nav-login { padding: 8px 12px; font-size: 12px; }
  .marketing-section { padding: 70px 0; }
  .marketing-hero-grid { min-height: auto; }
  .marketing-hero h1 { font-size: 39px; }
  .marketing-lead { font-size: 15px; }
  .marketing-hero-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  .marketing-text-link { width: fit-content; }
  .marketing-proof-grid > div { padding: 20px 14px; }
  .guided-demo-controls { grid-template-columns: 1fr; }
  .guided-demo-controls button { min-height: 52px; border-right: 0; border-bottom: 1px solid var(--marketing-line); }
  .guided-demo-stage { min-height: 300px; padding: 32px 24px; }
  .guided-demo-panel { grid-template-columns: 1fr; gap: 18px; }
  .demo-number { font-size: 52px; }
  .guided-demo-panel strong { font-size: 21px; }
  .onboarding-steps { grid-template-columns: 1fr; }
  .onboarding-steps li { min-height: 0; display: grid; grid-template-columns: 42px 1fr; gap: 16px; border-right: 1px solid #cfd5dc; border-top: 0; }
  .onboarding-steps li:first-child { border-top: 1px solid #cfd5dc; }
  .onboarding-steps li > span { margin: 0; }
  .pricing-card { padding: 28px 22px; }
  .profit-formula { grid-template-columns: 1fr; padding: 28px 22px; }
  .profit-formula b { text-align: center; }
  .preview-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .preview-metrics > div { padding: 10px; }
  .preview-metrics span { min-height: 33px; }
  .member-preview-main { padding: 18px; }
  .preview-feed { align-items: flex-start; }
  .preview-links { grid-template-columns: repeat(2, 1fr); }
  .contact-card { padding: 32px 22px; }
  .marketing-footer .marketing-container { flex-direction: column; }
}

/* ---- Account entry ---- */
.auth-body {
  min-height: 100vh;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  background: #f3f0e9;
  color: #132033;
}
.auth-body::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  min-height: 100%;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 0, rgba(46, 91, 128, .16), transparent 30%),
    linear-gradient(135deg, #0a1625 0%, #10263a 55%, #f3f0e9 55%, #f3f0e9 100%);
}
.auth-header {
  width: min(1240px, calc(100% - 64px));
  min-height: 72px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-header > a:first-child { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 14px; font-weight: 800; }
.auth-header img { width: 36px; height: 36px; }
.auth-header > a:last-child { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700; }
.auth-main { width: min(1240px, calc(100% - 64px)); max-width: 1240px; min-height: calc(100vh - 72px); margin: 0 auto; padding: 48px 0 80px; position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, 460px); gap: clamp(56px, 6vw, 88px); align-items: center; }
.auth-intro { min-width: 0; color: #fff; }
.auth-eyebrow { margin: 0 0 17px; color: #efae50; font-size: 10px; font-weight: 800; letter-spacing: .22em; }
.auth-intro h1 { max-width: 680px; margin: 0; font-size: clamp(42px, 4vw, 52px); line-height: 1.25; letter-spacing: -.04em; word-break: keep-all; overflow-wrap: normal; text-wrap: balance; }
.auth-intro > p:not(.auth-eyebrow) { max-width: 580px; margin: 23px 0 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.9; }
.auth-progress { margin: 38px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.auth-progress li { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.43); font-size: 10px; }
.auth-progress li span { display: flex; width: 25px; height: 25px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; }
.auth-progress li.active { border-top-color: #efae50; color: #fff; }
.auth-progress li.active span { border-color: #efae50; background: #efae50; color: #132033; }
.auth-detail-link { display: inline-block; margin-top: 28px; padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 12px; font-weight: 700; }
.auth-card { padding: 38px; background: #fff; border: 1px solid rgba(15,28,44,.08); box-shadow: 0 30px 90px rgba(8,18,31,.2); }
.auth-card-heading { margin-bottom: 26px; }
.auth-card-heading span { color: #a06b1d; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.auth-card-heading h2 { margin: 7px 0 4px; font-size: 25px; }
.auth-card-heading p { margin: 0; color: #758092; font-size: 11px; }
.auth-card form { display: grid; }
.auth-card form > label:not(.checkbox-row) { margin: 13px 0 5px; color: #3e4b5e; font-size: 11px; font-weight: 800; }
.auth-card input:not([type="checkbox"]) { min-height: 48px; border: 1px solid #ccd3dc; border-radius: 4px; background: #fafbfc; font: inherit; }
.auth-card input:focus { outline: 2px solid rgba(28,75,114,.18); border-color: #1c4b72; }
.auth-consent { margin-top: 18px; color: #5f6d7f; font-size: 11px; }
.auth-submit { min-height: 52px; margin-top: 21px; border: 0; border-radius: 5px; background: #132033; color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.auth-submit:hover { background: #20466a; }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-error { margin-top: 14px; color: var(--color-danger); font-size: 12px; text-align: center; }
.auth-price-note { margin: 18px 0 0; color: #7d8795; font-size: 10px; text-align: center; }
.auth-card-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 25px; padding-top: 18px; border-top: 1px solid #e1e5e9; font-size: 12px; }
.auth-card-footer span { color: #7a8594; }
.auth-card-footer a { color: #1c4b72; font-weight: 800; }
.auth-admin-link { margin: 22px 0 0; text-align: center; }
.auth-admin-link a { color: #8c95a2; font-size: 10px; }
.login-feature-grid { width: min(100%, 430px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 34px; }
.login-feature-grid span { padding: 12px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05); color: rgba(255,255,255,.75); font-size: 11px; }

@media (max-width: 980px) {
  .auth-body::before {
    background:
      radial-gradient(circle at 12% 0, rgba(46, 91, 128, .2), transparent 34%),
      linear-gradient(160deg, #0a1625 0%, #10263a 100%);
  }
  .auth-header > a:last-child { color: #fff; }
  .auth-main { width: min(640px, calc(100% - 40px)); grid-template-columns: 1fr; gap: 44px; padding-top: 44px; align-items: start; }
  .auth-intro { max-width: 600px; padding-bottom: 8px; }
  .auth-intro h1 { font-size: clamp(38px, 7vw, 48px); }
  .auth-card { width: min(100%, 540px); margin: 0 auto 48px; position: relative; z-index: 1; }
  .auth-card::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -24px;
    bottom: -100vh;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: #f3f0e9;
    clip-path: polygon(0 36px, 100% 0, 100% 100%, 0 100%);
  }
}

@media (max-width: 480px) {
  .auth-header,
  .auth-main { width: calc(100% - 28px); }
  .auth-header { min-height: 62px; }
  .auth-header > a:first-child { font-size: 12px; }
  .auth-header img { width: 32px; height: 32px; }
  .auth-main { min-height: auto; padding: 36px 0 56px; }
  .auth-intro h1 { font-size: 32px; word-break: normal; overflow-wrap: anywhere; }
  .auth-progress { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .auth-card { padding: 28px 21px; }
}

/* ---- Member dashboard hierarchy ---- */
.member-main { padding-top: 24px; }
.member-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 24px; border-radius: 16px; background: #101c2c; color: #fff; }
.member-welcome h1 { margin: 3px 0 2px; font-size: 26px; }
.member-welcome p { margin: 0; color: rgba(255,255,255,.58); font-size: 12px; }
.member-kicker { color: #bd7c25; font-family: "Avenir Next", sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.member-welcome .member-kicker { color: #efb15b; }
.member-outline-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid rgba(255,255,255,.27); border-radius: 8px; color: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.member-quick-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.member-quick-links a { min-width: 0; padding: 13px 12px; border: 1px solid #dde2e8; border-radius: 10px; background: #fff; color: #172438; box-shadow: 0 3px 12px rgba(14,28,45,.04); }
.member-quick-links strong,
.member-quick-links span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-quick-links strong { font-size: 12px; }
.member-quick-links span { margin-top: 3px; color: #788495; font-size: 9px; }
.member-panel { margin-bottom: 18px; padding: 16px; border: 1px solid #dde3e9; border-radius: 14px; background: #fff; }
.member-panel-heading,
.member-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.member-panel-heading h2,
.member-section-heading h2 { margin: 2px 0 0; font-size: 17px; }
.member-panel-heading > a,
.member-section-heading > a { color: #285678; font-size: 11px; font-weight: 800; }
.home-latest-notifications { display: grid; gap: 8px; }
.home-notification-row { position: relative; padding: 13px 14px; border: 1px solid #e1e5ea; border-radius: 9px; background: #fbfcfd; }
.home-notification-row.unread { border-left: 3px solid #d69335; background: #fffdf8; }
.home-notification-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #788394; font-size: 9px; }
.home-notification-meta span { color: #8c5d1e; font-weight: 800; }
.home-notification-row > strong { display: block; font-size: 12px; }
.home-notification-row > p { display: -webkit-box; overflow: hidden; margin: 4px 0 0; color: #677486; font-size: 11px; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-notification-row > a { display: inline-block; margin-top: 7px; color: #285678; font-size: 10px; font-weight: 800; }

@media (max-width: 620px) {
  .member-main { padding-top: 14px; }
  .member-welcome { align-items: flex-start; flex-direction: column; padding: 20px; }
  .member-welcome h1 { font-size: 23px; }
  .member-outline-button { width: 100%; }
  .member-quick-links { grid-template-columns: repeat(2, 1fr); }
  .member-quick-links a:last-child { grid-column: 1 / -1; }
}

/* ---- Phase5: 応募/購入タイムライン ---- */
.timeline { margin: 10px 0; padding: 10px; background: #f8fafc; border-radius: 10px; }
.timeline-step { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.timeline-step-label { color: var(--color-text-muted); flex-shrink: 0; }
.timeline-step-value { font-weight: 700; overflow-wrap: anywhere; text-align: right; min-width: 0; }
.timeline-arrow { text-align: center; color: var(--color-text-muted); font-size: 11px; line-height: 1.2; }
