/* =============================================================
   候補日時を書いてねトウマくん — style.css
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #FDF4EA;
  --surface:      #FFFFFF;
  --surface2:     #F5EAD8;
  --border:       rgba(73,167,206,0.15);
  --border2:      rgba(73,167,206,0.30);
  --text:         #2C2C2C;
  --muted:        #7A7A7A;
  --accent:       #49A7CE;
  --accent-dark:  #3388AD;
  --accent-light: rgba(73,167,206,0.10);
  --accent-glow:  rgba(73,167,206,0.20);
  --success:      #2DA870;
  --warning:      #D48A10;
  --danger:       #D64545;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.7;
}

/* ── ヘッダー ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.logo-img { width: 38px; height: 38px; border-radius: var(--radius-sm); display: block; }
.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.logo-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0;
}
.header-free-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  font-family: 'Noto Sans JP', sans-serif;
}

.header-usage-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

.header-usage-count strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ── ヒーロー ── */
.hero {
  background: linear-gradient(135deg, #FDF4EA 0%, #FEF1DA 50%, #FDF4EA 100%);
  border-bottom: 2px solid rgba(73,167,206,0.15);
  overflow: hidden;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.8rem 2rem 0;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}
.hero-text { flex: 1; padding-bottom: 2.5rem; }
.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lead { font-size: 0.92rem; color: var(--muted); line-height: 1.8; max-width: 560px; margin-bottom: 1.4rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #AAAAAA; flex-shrink: 0; display: inline-block; }
.hero-chara { flex-shrink: 0; width: 300px; height: 300px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.hero-chara img { width: 300px; height: 300px; object-fit: contain; object-position: bottom; display: block; }

/* ── ツール本体 ── */
.tool-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}
.tool-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.tool-inner { display: flex; gap: 24px; align-items: flex-start; }

/* 左：カレンダー＋生成テキスト */
.tool-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
  height: 480px;
  display: flex;
  flex-direction: column;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.cal-nav {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cal-nav:hover { background: var(--accent-light); border-color: var(--accent); }
.cal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.calendar-grid-wrap {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.calendar-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.calendar-dow span {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
  font-family: 'Outfit', sans-serif;
}
.calendar-dow .sat { color: var(--accent); }
.calendar-dow .sun { color: var(--danger); }
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 2px;
  flex: 1;
}
.cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 400;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  color: var(--text);
  position: relative;
  user-select: none;
}
.cal-cell:not(.past):not(.empty):hover { background: var(--accent-light); color: var(--accent-dark); }
.cal-cell.past   { color: #CCC; cursor: default; }
.cal-cell.empty  { cursor: default; }
.cal-cell.today  { font-weight: 700; color: var(--accent-dark); }
.cal-cell.sat    { color: var(--accent); }
.cal-cell.sun    { color: var(--danger); }
.cal-cell.sat.past, .cal-cell.sun.past { color: #CCC; }
.cal-cell.has-sel::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* 右：設定パネル */
.tool-right {
  width: 360px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
}

/* パネル共通 */
.panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
}
.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

/* 設定パネル */
.settings-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 12px; }

.setting-row { display: flex; flex-direction: column; gap: 5px; }
.setting-label { font-size: 0.75rem; font-weight: 500; color: var(--muted); }

.toggle-group { display: flex; flex-wrap: wrap; gap: 5px; }
.tgl {
  padding: 4px 11px;
  font-size: 0.75rem;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tgl.active { background: var(--accent); color: #FFF; border-color: var(--accent); font-weight: 500; }
.tgl:not(.active):hover { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent); }

/* コピーパネル */
.copy-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 10px; }
.copy-output-wrap {
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  padding: 12px 14px;
  min-height: 100px;
}
.copy-output {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.9;
}
.copy-btn {
  display: block;
  width: 100%;
  padding: 0.7rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.copy-btn:hover { background: var(--accent-dark); }
.copy-done {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: var(--success);
  font-weight: 500;
  height: 18px;
  opacity: 0;
  transition: opacity 0.2s;
}
.copy-done.show { opacity: 1; }

/* ── モーダル（PC・SP共通） ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  animation: fadeScale 0.2s ease;
}
@keyframes fadeScale {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.modal-date-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.modal-close {
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.modal-close:hover { background: var(--surface2); }
.modal-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.modal-time-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  overflow-y: auto;
  flex: 1;
  padding: 2px 0;
}
.modal-slot-btn {
  padding: 9px 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.modal-slot-btn.selected { background: var(--accent); color: #FFF; border-color: var(--accent); font-weight: 600; }
.modal-slot-btn:not(.selected):hover { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent); }
.modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.modal-clear {
  flex: 1;
  padding: 10px;
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.83rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s;
}
.modal-clear:hover { background: var(--surface2); }
.modal-done {
  flex: 2;
  padding: 10px;
  background: var(--accent);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-done:hover { background: var(--accent-dark); }

/* ── コンテンツセクション ── */
.content-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}
.section-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-lead { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.75rem; }

/* できること */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: box-shadow 0.15s;
}
.feature-card:hover { box-shadow: 0 4px 16px rgba(73,167,206,0.10); }
.feature-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.feature-title { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.feature-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.65; }

/* 使用例 */
.usecase-list { display: flex; flex-direction: column; gap: 1rem; }
.usecase-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.usecase-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-top: 1px;
}
.usecase-body strong { display: block; font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.usecase-body p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin: 0; }

/* 開発コスト */
.cost-table-wrap { overflow-x: auto; }
.cost-table { width: 100%; max-width: 480px; border-collapse: collapse; font-size: 0.9rem; }
.cost-table th, .cost-table td { padding: 0.7rem 1.1rem; text-align: left; border-bottom: 1px solid var(--border); background: var(--surface); }
.cost-table th { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.05em; color: var(--muted); background: var(--surface2); text-transform: uppercase; }
.cost-table td:nth-child(2), .cost-table td:nth-child(3) { text-align: right; }
.cost-table th:nth-child(2), .cost-table th:nth-child(3) { text-align: right; }
.cost-table-total td { font-weight: 600; color: var(--text); background: var(--accent-light); border-top: 2px solid var(--border2); border-bottom: none; }

/* ── レスポンシブ ── */
@media (max-width: 960px) {
  .tool-inner { flex-direction: column; }
  .tool-right { width: 100%; position: static; }
  .hero-chara { display: none; }
  /* SP・タブレットはカレンダー高さ固定を解除、セルをaspect-ratio正方形に戻す */
  .calendar-card { height: auto; }
  .calendar-days { grid-auto-rows: auto; flex: none; }
  .cal-cell { aspect-ratio: 1; }
}
@media (max-width: 768px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 85vh;
    animation: slideUp 0.22s ease;
  }
  @keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .modal-time-grid { grid-template-columns: repeat(4, 1fr); }
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .hero-inner { padding: 2rem 1.25rem 0; }
  .tool-section { padding: 1.75rem 1.25rem; }
  .content-section { padding: 2rem 1.25rem; }
  .features-grid { grid-template-columns: 1fr; }
  .header-usage-count { display: none; }
}
