/* デザイントークンは shinq-reserve/packages/platform-admin/src/index.css から写経。
   顧客は非エンジニア向け: 文字は大きめ・余白広め・情報量を絞る。 */

:root {
  --font-heading: "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, sans-serif;
  --font-body: "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, sans-serif;

  --text-h1: 2rem;
  --weight-h1: 700;
  --lh-h1: 1.3;
  --text-h2: 1.5rem;
  --weight-h2: 700;
  --lh-h2: 1.4;
  --text-h3: 1.25rem;
  --weight-h3: 600;
  --lh-h3: 1.4;
  --text-body: 1rem;
  --weight-body: 400;
  --lh-body: 1.8;
  --text-small: 0.875rem;
  --weight-small: 400;
  --lh-small: 1.6;

  --fg: #111827;
  --fg-dim: #374151;
  --fg-muted: #6b7280;
  --fg-faint: #9ca3af;
  --surface: #ffffff;
  --surface-dim: #f9fafb;
  --page-bg: #f9fafb;
  --edge: #e5e7eb;
  --edge-dim: #f3f4f6;
  --input-edge: #d1d5db;
  --subtle-bg: #e5e7eb;
  --subtle-fg: #4b5563;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --brand: #e30613;
  --brand-dark: #b8050f;
  --brand-50: #fce8e9;
  --brand-100: #f9d0d3;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 3px rgba(17, 24, 39, 0.08), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  white-space: nowrap;
}

img {
  max-width: 100%;
  display: block;
}

/* ヘッダー */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--edge);
  padding: var(--space-4) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav {
  display: flex;
  gap: var(--space-4);
}

.site-nav-link {
  font-size: var(--text-small);
  color: var(--fg-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}

.site-nav-link:hover {
  background: var(--surface-dim);
  color: var(--fg);
}

.brand {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  color: var(--brand-dark);
}

.breadcrumbs {
  padding: var(--space-3) var(--space-8) 0;
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.crumb {
  color: var(--fg-muted);
}

.crumb-current {
  color: var(--fg);
  font-weight: var(--weight-small);
}

.crumb-sep {
  margin: 0 var(--space-2);
  color: var(--fg-faint);
}

.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-8);
}

/* 導入部 */

.page-intro h1 {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  font-weight: var(--weight-h1);
  line-height: var(--lh-h1);
  margin: 0 0 var(--space-2);
}

.page-intro p {
  color: var(--fg-muted);
  margin: 0 0 var(--space-8);
}

/* 大項目カード(トップ) */

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

.module-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.module-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.module-card-order {
  font-size: var(--text-small);
  color: var(--fg-faint);
  margin-bottom: var(--space-2);
}

.module-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-2);
}

.module-card-meta {
  color: var(--fg-muted);
  font-size: var(--text-small);
  margin-bottom: var(--space-4);
}

.progress-bar {
  background: var(--edge-dim);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-sm {
  height: 6px;
}

.progress-bar-fill {
  background: var(--success);
  height: 100%;
  transition: width 0.2s ease;
}

/* トップページ: 進捗ガイド */

.overall-progress {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.overall-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.overall-progress-head h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0;
}

.overall-progress-count {
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.all-done-banner {
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  background: var(--success-bg);
  color: var(--success);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-h3);
}

.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.continue-card-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-1);
}

.continue-card-body p {
  margin: 0;
  color: var(--fg-dim);
}

.todays-picks {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.todays-picks h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-4);
}

.todays-picks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.todays-picks-item a {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--surface-dim);
}

.todays-picks-item a:hover {
  background: var(--edge-dim);
}

.todays-picks-module {
  font-size: var(--text-small);
  color: var(--fg-faint);
}

.todays-picks-name {
  color: var(--fg);
  font-weight: var(--weight-h3);
}

.module-grid-section h2 {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-4);
}

/* グループカード(大項目ページ) */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.group-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.group-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.group-card-thumb {
  background: var(--surface-dim);
  border-bottom: 1px solid var(--edge);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.group-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.group-card-body {
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.group-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-2);
}

.group-card-desc {
  color: var(--fg-muted);
  margin: 0;
}

/* バッジ */

.badge {
  display: inline-block;
  font-size: var(--text-small);
  font-weight: var(--weight-small);
  padding: 2px var(--space-2);
  border-radius: 999px;
  margin-left: var(--space-2);
  vertical-align: middle;
}

.badge-insufficient {
  background: var(--warn-bg);
  color: var(--warn);
}

/* グループ詳細ページ */

.node-detail {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.node-heading h1 {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  font-weight: var(--weight-h1);
  margin: 0 0 var(--space-6);
}

.node-representative {
  background: var(--surface-dim);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.node-description {
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--fg-dim);
  white-space: pre-wrap;
  margin: 0 0 var(--space-8);
}

.verdict-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface-dim);
  border: 1px dashed var(--edge);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-8);
}

.verdict-actions-note {
  color: var(--fg-dim);
  font-size: var(--text-small);
  margin: 0;
  margin-right: auto;
}

.verdict-status-value {
  color: var(--fg);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-body);
  font-weight: var(--weight-h3);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  box-shadow: var(--shadow-card-hover);
}

.btn kbd {
  font-size: 0.7rem;
  color: var(--fg-faint);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0 4px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-needed {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-bg);
}

.btn-needed[aria-pressed="true"] {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-not-needed {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-bg);
}

.btn-not-needed[aria-pressed="true"] {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.node-screens-heading {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-4);
}

.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.screen-thumb {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}

.screen-thumb:hover {
  box-shadow: var(--shadow-card-hover);
}

.screen-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
}

.screen-thumb-label {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-small);
  color: var(--fg-dim);
}

/* ライトボックス */

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.8);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.lightbox-image {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-label {
  margin: 0;
  text-align: center;
  color: var(--fg-dim);
}

.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--surface);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

/* コメント */

.node-comments {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--edge);
}

.node-comments-heading {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  margin: 0 0 var(--space-4);
}

.comment-list {
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.comment-item {
  background: var(--surface-dim);
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.comment-item-vendor {
  background: var(--brand-50);
  border-color: var(--brand-100);
}

.comment-item-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-small);
}

.comment-author {
  font-weight: var(--weight-h3);
  color: var(--fg);
}

.comment-side-badge {
  font-size: 0.7rem;
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: var(--subtle-bg);
  color: var(--subtle-fg);
}

.comment-side-badge-vendor {
  background: var(--brand-100);
  color: var(--brand-dark);
}

.comment-time {
  color: var(--fg-faint);
  margin-left: auto;
}

.comment-body {
  margin: 0;
  white-space: pre-wrap;
  color: var(--fg-dim);
}

.comment-empty {
  color: var(--fg-faint);
  font-size: var(--text-small);
  list-style: none;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-end;
}

.comment-textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-3);
  border: 1px solid var(--input-edge);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-body);
  resize: vertical;
}

/* 前後ナビ */

.node-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--edge);
}

.node-pager-slot {
  flex: 1;
}

/* トースト */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-8);
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: var(--surface);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.toast[hidden] {
  display: none;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* レビュー一覧 */

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.filter-pill {
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--fg-muted);
  font-size: var(--text-small);
}

.filter-pill:hover {
  background: var(--surface-dim);
}

.filter-pill-active {
  background: var(--fg);
  color: var(--surface);
  border-color: var(--fg);
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  overflow: hidden;
}

.review-table th,
.review-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--edge);
  font-size: var(--text-small);
}

.review-table th {
  background: var(--surface-dim);
  color: var(--fg-muted);
  font-weight: var(--weight-h3);
}

.review-table tbody tr:hover {
  background: var(--surface-dim);
}

.review-verdict {
  display: inline-block;
  padding: 2px var(--space-3);
  border-radius: 999px;
  font-weight: var(--weight-h3);
}

.review-verdict-needed {
  background: var(--success-bg);
  color: var(--success);
}

.review-verdict-not-needed {
  background: var(--danger-bg);
  color: var(--danger);
}

.review-verdict-undecided {
  background: var(--edge-dim);
  color: var(--fg-faint);
}

.review-comment-count {
  text-align: center;
}

.review-empty {
  text-align: center;
  color: var(--fg-faint);
  padding: var(--space-8);
}

/* ログインページ */

.login-panel {
  max-width: 420px;
  margin: var(--space-12) auto 0;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-8);
  text-align: center;
}

.login-title {
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  margin: 0 0 var(--space-2);
}

.login-lead {
  color: var(--fg-muted);
  margin: 0 0 var(--space-6);
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-small);
  margin: 0 0 var(--space-6);
  text-align: left;
}

.login-notice {
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-small);
  margin: 0;
}

.login-actions {
  display: flex;
  justify-content: center;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--fg);
  color: var(--surface);
  font-size: var(--text-body);
  font-weight: var(--weight-h3);
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease;
}

.btn-google:hover {
  opacity: 0.85;
}

.btn-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg);
  font-weight: 700;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .login-panel {
    margin-top: var(--space-6);
    padding: var(--space-6);
  }

  .site-main {
    padding: var(--space-4);
  }

  .site-header {
    padding: var(--space-3) var(--space-4);
  }

  .breadcrumbs {
    padding: var(--space-2) var(--space-4) 0;
  }

  .verdict-actions {
    flex-wrap: wrap;
  }

  .site-header {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .continue-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .node-pager {
    flex-wrap: wrap;
  }

  .node-pager-slot {
    display: none;
  }
}
