:root {
  --bg: #f7efe5;
  --surface: rgba(255, 251, 247, 0.88);
  --surface-strong: #fffaf4;
  --line: rgba(86, 65, 44, 0.12);
  --ink: #2f241d;
  --muted: #726457;
  --accent: #ef7d57;
  --accent-strong: #d25d36;
  --accent-soft: #ffe0d2;
  --success: #4f7f5d;
  --danger: #ad3d28;
  --shadow: 0 20px 50px rgba(84, 54, 30, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Pretendard", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(239, 125, 87, 0.25), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 214, 153, 0.45), transparent 32%),
    linear-gradient(180deg, #fff8f0 0%, var(--bg) 100%);
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: white;
  padding: 0.8rem 1rem;
  border: 0;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:hover {
  background: rgba(47, 36, 29, 0.05);
}

button.danger {
  color: var(--danger);
}

input,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 16px auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.sidebar,
.panel,
.hero {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.sidebar {
  border-radius: 28px;
  padding: 24px;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow: auto;
}

.brand {
  margin-bottom: 24px;
}

.brand h1,
.hero h2,
.panel h2 {
  margin: 0;
}

.brand h1 {
  font-size: 2.2rem;
}

.brand-copy,
.goal-description,
#heroCopy {
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--accent-strong);
  font-weight: 700;
}

.content {
  display: grid;
  gap: 20px;
  padding-bottom: 24px;
}

.hero {
  border-radius: 28px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: center;
}

.hero-stats,
.grid,
.goal-columns {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card,
.panel {
  border-radius: 24px;
}

.stat-card {
  background: var(--surface-strong);
  padding: 18px;
  border: 1px solid var(--line);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.6rem;
}

.panel {
  padding: 22px;
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-head,
.goal-head,
.subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 16px;
}

.stack-form,
.member-list,
.goal-list,
.step-list,
.milestone-list {
  display: grid;
  gap: 12px;
}

.compact {
  gap: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.pill.muted {
  background: rgba(114, 100, 87, 0.1);
  color: var(--muted);
}

.member-card,
.goal-card,
.step-item,
.milestone-item {
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.member-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
}

.member-card.active {
  outline: 2px solid var(--accent);
}

.member-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.member-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.member-actions,
.item-actions {
  display: flex;
  gap: 8px;
}

.member-actions button,
.item-actions button,
.goal-delete {
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
}

.goal-card {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.goal-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.goal-progress {
  display: grid;
  gap: 8px;
}

.progress-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(47, 36, 29, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f9a03f);
}

.progress-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.stamp-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stamp {
  min-width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: 2px dashed rgba(47, 36, 29, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
}

.stamp.done {
  color: white;
  border-style: solid;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #f39c6b);
  transform: rotate(-6deg);
}

.goal-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-item,
.milestone-item {
  border-radius: 16px;
  padding: 12px 14px;
}

.step-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.step-item.done .step-title {
  text-decoration: line-through;
  color: var(--muted);
}

.step-check {
  width: 18px;
  height: 18px;
}

.milestone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.milestone-copy strong,
.milestone-copy span {
  display: block;
}

.milestone-copy span {
  color: var(--muted);
  margin-top: 4px;
}

.empty-state {
  color: var(--muted);
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.hidden {
  display: none !important;
}

.form-error {
  margin: -2px 0 0;
  color: var(--danger);
  font-size: 0.92rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 36, 29, 0.42);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-copy {
  margin: 8px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1100px) {
  .app-shell,
  .hero,
  .grid,
  .goal-columns {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto;
  }

  .sidebar,
  .panel,
  .hero {
    padding: 18px;
    border-radius: 22px;
  }

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

  .inline-form,
  .goal-head,
  .milestone-item,
  .panel-head,
  .modal-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}
