:root {
  --bg: #f7f1e8;
  --card: #fffaf2;
  --text: #202820;
  --muted: #697367;
  --line: #e6d9c7;
  --primary: #406b53;
  --primary-dark: #284d39;
  --primary-soft: #dcebdd;
  --accent: #c27845;
  --shadow: 0 18px 50px rgba(55, 39, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 92px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 16px;
}

.hero h1 {
  margin: 4px 0;
  font-size: clamp(32px, 9vw, 46px);
  letter-spacing: -0.06em;
}

.subtle,
.helper-text,
.quiet-card p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.day-pill {
  align-self: start;
  min-width: 92px;
  padding: 12px;
  border: 1px solid rgba(64, 107, 83, 0.18);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: var(--shadow);
  text-align: center;
}

.day-pill span {
  display: block;
  color: var(--primary-dark);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.day-pill small {
  color: var(--muted);
  font-size: 12px;
}

.hero-card {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(135deg, #416c54, #2f5640);
  color: white;
  box-shadow: var(--shadow);
}

.hero-card p {
  margin: 0;
}

.phase-label {
  margin-bottom: 6px !important;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-track span {
  display: block;
  width: 1%;
  height: 100%;
  border-radius: inherit;
  background: #fff6da;
  transition: width 220ms ease;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  margin: 14px 0;
  padding: 18px;
  border: 1px solid rgba(79, 62, 38, 0.08);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.completion-banner {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 16px 18px;
  border: 1px solid rgba(64, 107, 83, 0.25);
  border-radius: 24px;
  background: #e7f3df;
  color: var(--primary-dark);
  box-shadow: 0 14px 36px rgba(64, 107, 83, 0.14);
}

.completion-banner[hidden] {
  display: none;
}

.completion-banner strong {
  font-size: 18px;
  font-weight: 950;
}

.completion-banner span {
  color: #4c6657;
  line-height: 1.5;
}

.completed-record[hidden],
.record-details[hidden],
#todayForm[hidden] {
  display: none;
}

.record-details {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.record-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
}

.record-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.record-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.record-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-list li {
  color: var(--muted);
  line-height: 1.55;
}

.task-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.task-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary);
}

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

.soft-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdf8;
}

.task-item input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.task-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 850;
}

.task-detail {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 850;
  line-height: 1.5;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  background: #fffdf8;
  color: var(--text);
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: rgba(64, 107, 83, 0.55);
  box-shadow: 0 0 0 4px rgba(64, 107, 83, 0.12);
}

.optional-field[hidden] {
  display: none;
}

.ghost-button,
.primary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.ghost-button {
  margin-top: 14px;
  border: 1px solid rgba(64, 107, 83, 0.2);
  background: #fffdf8;
  color: var(--primary-dark);
}

.text-button {
  display: block;
  margin: 16px auto 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-decoration: underline;
  cursor: pointer;
}

.primary-action {
  margin-top: 8px;
  background: var(--primary);
  color: white;
  box-shadow: 0 14px 30px rgba(64, 107, 83, 0.25);
}

.primary-action.completed {
  background: var(--primary-dark);
  box-shadow: 0 14px 30px rgba(40, 77, 57, 0.28);
}

.primary-action.small {
  margin-top: 18px;
}

.feedback {
  min-height: 24px;
  margin: 10px 2px 0;
  color: var(--primary-dark);
  font-weight: 750;
  text-align: center;
}

.feedback.success {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(220, 235, 221, 0.9);
}

.phase-list {
  display: grid;
  gap: 10px;
}

.phase-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
}

.phase-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #efe3d1;
  color: var(--muted);
  font-weight: 900;
}

.phase-item.current {
  border-color: rgba(64, 107, 83, 0.36);
  background: #f6fbf2;
}

.phase-item.current .phase-index {
  background: var(--primary);
  color: white;
}

.phase-name {
  font-weight: 850;
}

.phase-days,
.phase-status {
  color: var(--muted);
  font-size: 13px;
}

.phase-status {
  font-weight: 850;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(79, 62, 38, 0.1);
  background: rgba(255, 250, 242, 0.9);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 28px;
  }
}
