:root {
  color-scheme: light;
  --ink: #111113;
  --muted: #6f7177;
  --line: rgba(18, 18, 20, 0.1);
  --soft: rgba(255, 255, 255, 0.72);
  --panel: rgba(255, 255, 255, 0.86);
  --blue: #2f6fed;
  --green: #20a66a;
  --violet: #7357d8;
  --amber: #b98218;
  --rose: #d84d68;
  --cyan: #0a8fa3;
  --slate: #69707c;
}

* {
  box-sizing: border-box;
}

html {
  background: #f5f5f7;
}

body {
  min-width: 320px;
  margin: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 245, 247, 0.5) 34rem),
    #f5f5f7;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 880px;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.96;
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.1;
}

h3 {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.hero-band {
  border-bottom: 1px solid rgba(17, 17, 19, 0.06);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 245, 247, 0.72)),
    linear-gradient(90deg, rgba(47, 111, 237, 0.08), rgba(32, 166, 106, 0.05));
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-strip {
  display: grid;
  min-width: min(100%, 460px);
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 44px rgba(20, 20, 24, 0.06);
  backdrop-filter: blur(18px);
}

.stats-strip div {
  min-width: 0;
  padding: 1.05rem 1rem;
  border-left: 1px solid rgba(17, 17, 19, 0.08);
}

.stats-strip div:first-child {
  border-left: 0;
}

.stats-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.stats-strip strong {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 720;
  line-height: 1;
}

.goal-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.goal-item {
  display: flex;
  min-height: 92px;
  gap: 0.85rem;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.68);
}

.goal-item span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 760;
}

.goal-item p {
  color: #292b30;
  font-size: 0.95rem;
  line-height: 1.55;
}

.surface {
  min-width: 0;
  border: 1px solid rgba(18, 18, 20, 0.08);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 22px 50px rgba(24, 24, 28, 0.07);
  backdrop-filter: blur(20px);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(17, 17, 19, 0.07);
}

.weekly-grid {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.week-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
}

.week-card::before,
.day-detail::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--accent);
}

.weekday {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 760;
}

.load-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.36rem 0.62rem;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 720;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.meta-line span {
  border-radius: 999px;
  padding: 0.34rem 0.58rem;
  color: #555961;
  background: #f3f4f6;
  font-size: 0.76rem;
  font-weight: 650;
}

.meta-line.larger {
  margin-bottom: 1rem;
}

.meta-line.larger span {
  padding: 0.45rem 0.72rem;
  font-size: 0.82rem;
}

.week-card ol,
.detail-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  color: #2f3238;
}

.week-card li,
.detail-list li {
  margin-top: 0.45rem;
  line-height: 1.58;
}

.match-rule {
  margin-top: 1rem;
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  color: #3e4147;
  background: #f6f7f8;
  font-size: 0.9rem;
  line-height: 1.55;
}

.month-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 999px;
  padding: 0.25rem;
  background: #fff;
}

.month-controls button {
  display: grid;
  min-width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #2d3035;
  background: transparent;
  font-size: 1.3rem;
}

.month-controls .today-button {
  min-width: 3.5rem;
  padding: 0 0.75rem;
  color: #fff;
  background: #111113;
  font-size: 0.85rem;
  font-weight: 700;
}

.calendar-wrap {
  padding: 1rem;
}

.weekday-grid,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
}

.weekday-grid {
  margin-bottom: 0.55rem;
}

.weekday-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.calendar-cell {
  display: flex;
  min-height: 134px;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 16px;
  padding: 0.75rem;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.calendar-cell:hover {
  border-color: rgba(17, 17, 19, 0.2);
  transform: translateY(-1px);
}

.calendar-cell.empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.calendar-cell.selected {
  border-color: #111113;
  box-shadow: 0 0 0 2px #111113 inset;
}

.calendar-cell.done {
  background: linear-gradient(180deg, #fff, #f7fbf9);
}

.cell-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.date-number {
  font-size: 1.05rem;
  font-weight: 760;
}

.check {
  appearance: none;
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid rgba(17, 17, 19, 0.16);
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

.check.checked {
  border-color: var(--green);
  background: var(--green);
}

.plan-dot {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.78rem;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-cell strong {
  display: -webkit-box;
  min-height: 2.8rem;
  margin-top: 0.45rem;
  overflow: hidden;
  color: #25272c;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-cell small {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.mini-progress,
.progress-track {
  overflow: hidden;
  height: 0.42rem;
  border-radius: 999px;
  background: #e9eaed;
}

.mini-progress {
  margin-top: auto;
}

.mini-progress span,
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--blue));
}

.day-detail {
  position: relative;
  overflow: hidden;
}

.done-button {
  flex: 0 0 auto;
  min-width: 5.5rem;
  height: 2.35rem;
  border: 1px solid rgba(17, 17, 19, 0.1);
  border-radius: 999px;
  color: #17181b;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 720;
}

.done-button.active {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: 1.2rem;
  padding: 1.25rem;
}

.detail-rule {
  background: var(--accent-soft);
}

.completion-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 18px;
  padding: 1rem;
  background: #fff;
}

.completion-box label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.completion-box strong {
  font-size: 2.45rem;
  font-weight: 760;
  line-height: 1;
}

.completion-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.completion-box textarea {
  min-height: 130px;
  resize: vertical;
  border: 1px solid rgba(17, 17, 19, 0.1);
  border-radius: 14px;
  padding: 0.85rem;
  color: #26282e;
  background: #f8f8fa;
  outline: none;
}

.completion-box textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.progress-list {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.65fr) 3.2rem;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(17, 17, 19, 0.08);
  border-radius: 16px;
  padding: 0.85rem;
  background: #fff;
}

.progress-row > div:first-child {
  min-width: 0;
}

.progress-row .plan-dot {
  display: inline-block;
  margin: 0 0.5rem 0 0;
  vertical-align: 0.08rem;
}

.progress-row strong {
  color: #25272c;
  font-size: 0.92rem;
}

.progress-row small {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.progress-row b {
  text-align: right;
}

.tone-blue {
  --accent: var(--blue);
  --accent-soft: #edf3ff;
  --accent-ring: rgba(47, 111, 237, 0.16);
}

.tone-green {
  --accent: var(--green);
  --accent-soft: #edf8f3;
  --accent-ring: rgba(32, 166, 106, 0.16);
}

.tone-violet {
  --accent: var(--violet);
  --accent-soft: #f2efff;
  --accent-ring: rgba(115, 87, 216, 0.16);
}

.tone-amber {
  --accent: var(--amber);
  --accent-soft: #fff7e8;
  --accent-ring: rgba(185, 130, 24, 0.18);
}

.tone-rose {
  --accent: var(--rose);
  --accent-soft: #fff0f3;
  --accent-ring: rgba(216, 77, 104, 0.16);
}

.tone-cyan {
  --accent: var(--cyan);
  --accent-soft: #eaf8fa;
  --accent-ring: rgba(10, 143, 163, 0.16);
}

.tone-slate {
  --accent: var(--slate);
  --accent-soft: #f1f3f5;
  --accent-ring: rgba(105, 112, 124, 0.16);
}

@media (max-width: 1024px) {
  .goal-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: clamp(2.35rem, 14vw, 4.2rem);
  }

  .stats-strip {
    grid-template-columns: 1fr;
  }

  .stats-strip div {
    border-top: 1px solid rgba(17, 17, 19, 0.08);
    border-left: 0;
  }

  .stats-strip div:first-child {
    border-top: 0;
  }

  .goal-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .calendar-wrap {
    overflow-x: auto;
  }

  .weekday-grid,
  .calendar-grid {
    min-width: 720px;
  }

  .calendar-cell {
    min-height: 128px;
  }

  .progress-row {
    grid-template-columns: 1fr;
  }

  .progress-row b {
    text-align: left;
  }
}
