:root {
  /* Phase 1 */
  --phase1-bg: #EEEDFE;
  --phase1-accent: #534AB7;
  --phase1-text: #3C3489;
  /* Phase 2 */
  --phase2-bg: #E1F5EE;
  --phase2-accent: #0F6E56;
  --phase2-text: #085041;
  /* Phase 3 */
  --phase3-bg: #FAEEDA;
  --phase3-accent: #854F0B;
  --phase3-text: #633806;
  /* Phase 4 */
  --phase4-bg: #FAECE7;
  --phase4-accent: #993C1D;
  --phase4-text: #711213;

  --text-main: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg-code: #f5f5f5;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-main);
  background: #fff;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.4;
}

.site-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.progress-tracker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--phase1-accent), var(--phase2-accent), var(--phase3-accent), var(--phase4-accent));
  width: 0%;
  transition: width 0.3s ease;
}

/* Phase nav */
.phase-nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  padding: 12px 0;
}

.phase-nav-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.phase-nav-btn {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s, box-shadow 0.1s;
  font-family: inherit;
}

.phase-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.phase-nav-btn .label {
  font-size: 11px;
  display: block;
  opacity: 0.8;
  font-weight: 500;
}

/* Phase sections */
.phase-section {
  margin: 48px 0;
  scroll-margin-top: 80px;
}

.phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  background: var(--bg);
  color: var(--text);
}

.phase-header-left {
  flex: 1;
}

.phase-header .label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}

.phase-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 700;
}

.phase-header .days-range {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.accordion-toggle {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.2s;
  font-family: inherit;
}

.phase-section.collapsed .accordion-toggle {
  transform: rotate(-90deg);
}

.phase-section.collapsed .day-grid {
  display: none;
}

/* Day grid */
.day-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .day-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 460px) {
  .day-grid {
    grid-template-columns: 1fr;
  }
}

.day-card {
  padding: 14px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  font-family: inherit;
  text-align: left;
  width: 100%;
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.day-card.active {
  border-color: var(--accent);
}

.day-card.completed::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}

.day-number {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.day-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* Detail panel */
.day-detail {
  grid-column: 1 / -1;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 24px;
  margin-top: 4px;
  animation: fadeIn 0.2s ease;
}

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

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--accent);
}

.detail-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  font-family: inherit;
}

.detail-close:hover {
  background: var(--bg);
  color: var(--text-main);
}

.detail-goal {
  font-size: 15px;
  margin: 0 0 16px;
  color: var(--text-main);
}

.detail-block {
  margin-bottom: 16px;
}

.detail-block-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.detail-task {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
}

.prompt-block {
  position: relative;
  background: var(--bg-code);
  border-radius: 8px;
  padding: 14px 16px;
  padding-right: 100px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: #1a1a1a;
}

.prompt-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.1s;
}

.copy-btn:hover {
  opacity: 0.9;
}

.copy-btn.copied {
  background: #16a34a;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.complete-btn {
  padding: 8px 14px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.complete-btn:hover {
  background: var(--bg);
}

.complete-btn.completed {
  background: var(--accent);
  color: #fff;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 600px) {
  .site-title { font-size: 22px; }
  .site-subtitle { font-size: 14px; }
  .phase-header h2 { font-size: 18px; }
  .site-header { padding: 32px 0 24px; }
  .prompt-block { padding-right: 16px; }
  .copy-btn {
    position: static;
    margin-top: 10px;
    display: inline-block;
  }
}
