:root {
  --pj-blue: #1a56db;
  --pj-blue-dark: #133e9e;
  --pj-blue-pale: #eaf1fd;
  --pj-amber: #f5b400;
  --pj-amber-dim: #d9d9d9;
  --pj-text: #1f2430;
  --pj-text-sub: #6b7280;
  --pj-bg: #eef1f6;
  --pj-card-bg: #ffffff;
  --pj-border: #e3e7ee;
  --pj-success: #1a9e63;
  --pj-danger: #d9455f;
  --pj-radius: 16px;
  --pj-shadow: 0 4px 16px rgba(20, 30, 60, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ブラウザ/OSのダークモードで自動的に配色を反転させない */
html {
  color-scheme: light;
}

body {
  font-family:
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: #f5f7fa;
  color: #222222;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 全体レイアウト ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  min-height: 100vh;
  background-color: #f5f7fa;
  color: #222222;
}

/* ---------- カード風の本体フレーム ---------- */
.phone-frame {
  background: transparent;
}

.screen {
  animation: fadeIn 0.25s ease;
}

.screen-hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- ブランドヘッダー ---------- */
.brand-header {
  text-align: center;
  padding: 20px 0 8px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pj-blue), var(--pj-blue-dark));
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--pj-shadow);
}

.brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #1f2937;
}

.brand-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}

/* ---------- カード ---------- */
.card {
  background-color: #ffffff;
  color: #222222;
  border-radius: var(--pj-radius);
  box-shadow: var(--pj-shadow);
  padding: 22px 20px;
  margin-top: 14px;
}

.card-google {
  text-align: center;
}

.card-muted {
  background: #f7f8fa;
  box-shadow: none;
  border: 1px solid var(--pj-border);
}

.lead-text {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.7;
  color: #6b7280;
}

.lead-text-strong {
  text-align: center;
  font-size: 15.5px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.6;
}

/* ---------- フィールド ---------- */
.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1f2937;
}

.text-input {
  width: 100%;
  border: 1px solid var(--pj-border);
  border-radius: 10px;
  padding: 12px 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfbfd;
  resize: vertical;
}

.text-input:focus {
  outline: none;
  border-color: var(--pj-blue);
  background: #fff;
}

/* ---------- チェックボックス ---------- */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--pj-blue);
}

/* ---------- 星評価 ---------- */
.star-rating {
  display: flex;
  gap: 2px;
  justify-content: center;
  padding: 8px 0;
}

.star {
  background: none;
  border: none;
  font-size: 46px;
  line-height: 1;
  color: var(--pj-amber-dim);
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  transition:
    transform 0.12s ease,
    color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.star:active {
  transform: scale(0.9);
}

.star.is-filled {
  color: var(--pj-amber);
}

.star-caption {
  text-align: center;
  margin: 10px 0 0;
  font-size: 13px;
  color: #6b7280;
  min-height: 18px;
}

/* ---------- ボタン ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition:
    opacity 0.15s ease,
    transform 0.05s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--pj-blue);
  color: #fff;
}

.btn-primary:disabled {
  background: #b9c6e6;
  color: #374151;
  cursor: not-allowed;
}

.btn-google {
  background: #fff;
  color: #1f2430;
  border: 1px solid var(--pj-border);
  box-shadow: 0 2px 8px rgba(20, 30, 60, 0.1);
}

.google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #4285f4,
    #34a853 50%,
    #fbbc05 75%,
    #ea4335
  );
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
  color: #374151;
  font-weight: 500;
  margin-top: 18px;
  font-size: 13px;
}

.error-text {
  color: var(--pj-danger);
  font-size: 12.5px;
  text-align: center;
  min-height: 16px;
  margin: 10px 0 0;
}

/* ---------- 結果画面共通 ---------- */
.result-icon {
  width: 64px;
  height: 64px;
  margin: 28px auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
}

.result-icon-success {
  background: var(--pj-success);
}

.result-icon-neutral {
  background: #9aa3b2;
}

.result-title {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #1f2937;
}

.result-text {
  text-align: center;
  font-size: 13.5px;
  line-height: 1.8;
  color: #6b7280;
  margin: 0 auto;
  max-width: 320px;
}

.shared-note {
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: #374151;
  background: var(--pj-blue-pale);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px auto 0;
  max-width: 340px;
}

.google-lead {
  font-size: 14px;
  color: #374151;
  margin: 0 0 16px;
  line-height: 1.6;
}

.muted-note {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--pj-text-sub);
  margin: 0;
}

#restartBtnGoogle,
#restartBtnInternal {
  display: block;
  text-align: center;
}

/* ---------- 完了画面の文字色 強制固定（キャッシュ・古いCSS残存対策） ---------- */
/* 画面のルート要素はclassではなくid（#screen-google / #screen-internal）のため、
   id指定 + クラス単体指定の両方でカバーする */
#screen-google .result-title,
#screen-internal .result-title,
.result-title {
  color: #1f2937 !important;
}

#screen-google .result-text,
#screen-internal .result-text,
.result-text {
  color: #6b7280 !important;
}

#screen-google .google-lead,
.google-lead {
  color: #374151 !important;
}

#screen-google .shared-note,
#screen-internal .shared-note,
.shared-note {
  color: #374151 !important;
}

.btn-ghost {
  color: #374151 !important;
}
