:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6ea;
  --text: #1f2430;
  --text-muted: #6b7280;
  --accent: #2a9d8f;
  --accent-dark: #21807a;
  --accent-bg: #e9f6f4;
  --danger: #e63946;
  --danger-bg: #fdecee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

h1 { font-size: 1.35em; margin: 0 0 6px; }
.page-desc { color: var(--text-muted); margin: 0 0 28px; font-size: 0.92em; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.date-label { font-weight: 600; margin-bottom: 10px; font-size: 0.95em; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.slot-btn {
  padding: 10px 4px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.92em;
  font-family: inherit;
}
.slot-btn:hover { background: var(--accent); color: #fff; }

.empty-state { color: var(--text-muted); text-align: center; padding: 20px 0; }

dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: 92%;
  max-width: 420px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}
dialog::backdrop { background: rgba(15, 20, 25, 0.45); }
dialog form { padding: 22px 22px 20px; }
dialog h2 { font-size: 1.05em; margin: 0 0 4px; }
dialog .slot-summary { color: var(--accent-dark); font-weight: 600; margin: 0 0 16px; font-size: 0.95em; }
dialog .form-error { color: var(--danger); font-weight: 700; margin: 0 0 14px; font-size: 0.95em; }

label { display: block; font-size: 0.85em; color: var(--text-muted); margin: 12px 0 4px; }
label:first-of-type { margin-top: 0; }
input, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.field-tooltip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 7px 10px;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: 6px;
  color: var(--danger);
  font-size: 0.82em;
  font-weight: 600;
}
.field-tooltip::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 0.75em; flex-shrink: 0; }

.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.95em;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-danger:hover { background: var(--danger-bg); }
.btn:disabled { opacity: 0.7; cursor: default; }
.btn .spinner[hidden] { display: none; }
.btn .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  /* currentColorを使うことで、ボタンの文字色(塗りつぶしボタンなら白、.btn-dangerのような
     白背景+色文字のボタンならその色)に自動で馴染む。 */
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: 0.8;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.result-page { text-align: center; padding-top: 24px; }
.result-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 1.6em;
  background: var(--accent-bg); color: var(--accent-dark);
}
.result-icon.muted { background: #f1f2f4; color: var(--text-muted); }
.meta-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.92em; }
.meta-row:last-child { border-bottom: none; }
.meta-row .label { color: var(--text-muted); }

@media (max-width: 480px) {
  .wrap { padding: 24px 14px 48px; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .dialog-actions { flex-direction: column; }
}

/* Google連携時の「このアプリは確認されていません」画面を、事前に知ってもらうための
   再現モックアップ。実際のGoogle画面の配色・レイアウトに忠実に寄せる一方、
   「どこを押すか」の指示は地の文とは分離し、モック内の該当要素に赤い枠を
   重ねるだけにする(文中に色付きバッジを埋め込むと折り返し時に文字が詰まって
   見えるため、地の文には一切装飾を入れない)。*/
.oauth-guide { text-align: left; margin: 24px 0; }
.oauth-guide-title { font-weight: 700; font-size: 0.95em; margin-bottom: 4px; }
.oauth-guide-desc { color: var(--text-muted); font-size: 0.85em; margin-bottom: 20px; }
.oauth-step { margin-bottom: 22px; }
.oauth-step-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.oauth-step-num {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.75em; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.oauth-step-text { font-size: 0.85em; margin: 0; line-height: 1.6; }

/* ここから、実際のGoogle画面の配色・タイポグラフィに合わせたモック */
.google-mock {
  border: 1px solid #dadce0; border-radius: 8px; background: #fff;
  padding: 24px 20px; font-family: Roboto, Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
  box-shadow: 0 1px 2px rgba(60,64,67,0.12);
}
.google-mock + .google-mock { margin-top: 10px; }
.google-mock-icon { margin-bottom: 12px; }
.google-mock-title { font-size: 1.1em; font-weight: 400; color: #202124; margin: 0 0 14px; line-height: 1.35; }
.google-mock-body { font-size: 0.82em; color: #5f6368; line-height: 1.6; margin: 0 0 16px; }
.google-mock-body a { color: #1a73e8; text-decoration: none; }
.google-mock-detail {
  font-size: 0.82em; color: #202124; text-decoration: underline; display: inline-block;
  background: none; border: none; padding: 0; font-family: inherit; cursor: default;
}
.google-mock-link { font-size: 0.82em; color: #1a73e8; text-decoration: underline; display: inline-block; }
.google-mock-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.google-mock-btn-blue {
  display: inline-block; padding: 8px 22px; border-radius: 4px; background: #1a73e8;
  color: #fff; font-size: 0.82em; font-weight: 500;
}
.google-mock-account {
  display: flex; align-items: center; gap: 12px; border: 1px solid #dadce0; border-radius: 8px;
  padding: 10px 14px; margin-top: 4px;
}
.google-mock-avatar {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: #7c4dff;
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.85em; font-weight: 700;
}
.google-mock-account-email { font-size: 0.85em; color: #202124; }
.google-mock-caution {
  display: flex; gap: 10px; background: #fef7e0; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px;
}
.google-mock-caution-text { font-size: 0.78em; color: #202124; line-height: 1.6; margin: 0; }
.google-mock-scope-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid #e8eaed;
}
.google-mock-scope-row input { width: auto; margin: 3px 0 0; }
.google-mock-scope-text { font-size: 0.82em; color: #202124; line-height: 1.5; }
.google-mock-pill-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.google-mock-pill {
  display: inline-block; padding: 8px 20px; border-radius: 20px; border: 1px solid #dadce0;
  color: #1a73e8; font-size: 0.82em; font-weight: 500; background: #fff;
}

/* クリック対象への注釈(赤い枠のみ。対象自身の文字サイズ・色は一切変えない) */
.oauth-target {
  outline: 2px solid #ea4335; outline-offset: 3px; border-radius: 4px;
}
.oauth-callout {
  display: block; color: #ea4335; font-size: 0.75em; font-weight: 700; margin-top: 8px;
}

/* 予約者が自分のGoogleカレンダーと照合して空き時間だけに絞り込む(任意機能)のカード */
.overlay-card { text-align: center; }
.overlay-title { margin: 0 0 10px; font-weight: 700; font-size: 0.95em; }
.overlay-notice { margin: 0 0 10px; color: var(--danger); font-size: 0.85em; }
.overlay-card .hint { margin: 10px 0 0; }

/* カケハシのロゴ(ワードマーク)。予約者が見る画面の最上部に小さく置く */
.brand-bar { margin-bottom: 14px; }
.brand-logo { height: 30px; border-radius: 7px; width: auto; display: block; }
.result-page .brand-bar { margin-bottom: 22px; }
.result-page .brand-logo { margin: 0 auto; }
