* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: #0F1B14;
  color: #EDE8DC;
  min-height: 100vh;
}

.screen { min-height: 100vh; }

/* [hidden] must always win: without this, the ID-selector rules below
   (which set display:flex on #login-screen) have higher specificity than
   the browser's default [hidden]{display:none}, so a "hidden" screen would
   still render - stacked above the other screen, requiring a scroll to see
   past it instead of actually disappearing. */
.screen[hidden] { display: none !important; }

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: #16261C;
  border: 1px solid #24392C;
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
}

.login-card h1 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 8px;
}

.hint {
  font-size: 14px;
  color: #8FA396;
  margin: 0 0 24px;
}

#code-input {
  width: 100%;
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
  padding: 12px 0;
  border-radius: 8px;
  border: 1px solid #2E4636;
  background: #0F1B14;
  color: #EDE8DC;
  margin-bottom: 16px;
}

#code-input:focus {
  outline: none;
  border-color: #E8A33D;
}

#login-form button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #E8A33D;
  color: #412402;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

#login-form button:active { transform: scale(0.98); }

.error {
  color: #F09595;
  font-size: 13px;
  min-height: 18px;
  margin: 12px 0 0;
}

/* App */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #24392C;
}

.brand { font-size: 15px; font-weight: 500; }

.ghost-btn {
  background: none;
  border: 1px solid #2E4636;
  color: #8FA396;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.ghost-btn:hover { border-color: #E8A33D; color: #E8A33D; }

.tabbar {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
  border-bottom: 1px solid #24392C;
  max-width: 720px;
  margin: 0 auto;
}

.tab-btn {
  background: none;
  border: none;
  color: #8FA396;
  font-size: 14px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: #EDE8DC; border-bottom-color: #E8A33D; }
.tab-btn:hover:not(.active) { color: #EDE8DC; }

.section-subtitle {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #E8A33D;
  margin: 14px 0 4px;
}
.section-subtitle:first-child { margin-top: 0; }

.section-desc {
  font-size: 13px;
  color: #A8B5AB;
  line-height: 1.5;
  margin: 0 0 8px;
}

/* Heatmap */
.heatmap-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

#heatmap {
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#heatmap::-webkit-scrollbar { display: none; }

.heatmap-months {
  display: flex;
  margin-bottom: 4px;
  margin-left: 24px;
}
.heatmap-month-label {
  font-size: 11px;
  color: #8FA396;
  flex-shrink: 0;
}

.heatmap-body { display: flex; gap: 6px; }

.heatmap-weekdays {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  font-size: 10px;
  color: #8FA396;
  width: 20px;
  flex-shrink: 0;
}
.heatmap-weekdays span { line-height: 12px; }

.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
}

.heat-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  cursor: pointer;
  background: #16261C;
  border: 1px solid #24392C;
}
.heat-cell.empty { cursor: default; border: none; background: transparent; }
.heat-cell.is-today { outline: 1.5px solid #E8A33D; outline-offset: 1px; }
.heat-cell:not(.empty):hover { outline: 1px solid #E8A33D; outline-offset: 1px; }

.heatmap-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: #8FA396; }
.heatmap-legend .heat-cell { cursor: default; width: 10px; height: 10px; }
.heat-swatch-3 { background: #7FA65C; border: 1px solid #7FA65C; }
.heatmap-hint { margin-left: 4px; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.progress-label { font-size: 14px; color: #8FA396; }
.progress-pct { font-size: 14px; font-weight: 500; }

.progress-track {
  height: 6px;
  background: #16261C;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 32px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: #7FA65C;
  transition: width .3s;
}

.phase-row {
  display: flex;
  gap: 14px;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
}

.dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  background: #16261C;
  color: #8FA396;
}
.dot.active { background: #3A2E12; color: #E8A33D; }
.dot.complete { background: #23331A; color: #7FA65C; }

.line {
  width: 2px;
  flex: 1;
  background: #24392C;
  margin-top: 4px;
  min-height: 20px;
}

.phase-body {
  flex: 1;
  padding-bottom: 28px;
}

.phase-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2px;
}
.phase-title { font-size: 15px; font-weight: 500; }
.phase-time { font-size: 12px; color: #8FA396; }

.phase-desc {
  font-size: 13px;
  color: #A8B5AB;
  line-height: 1.5;
  margin: 4px 0 10px;
}

.phase-sub {
  font-size: 12px;
  color: #6B7A6F;
  margin-bottom: 10px;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.item-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: #7FA65C;
  width: 16px;
  height: 16px;
}

.item-row.done { color: #6B7A6F; text-decoration: line-through; }
.item-row:not(.done) { color: #EDE8DC; }

@media (max-width: 480px) {
  .container { padding: 24px 16px 60px; }
}
