:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0eee8;
  color: #1f2b25;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 32px 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 42%),
    #f0eee8;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 560px);
  padding: clamp(24px, 6vw, 48px);
  background: #fffdf8;
  border: 1px solid #dedbd2;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(42, 53, 47, 0.12);
}

.eyebrow {
  margin: 0 0 8px;
  color: #bd5b37;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 8vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro {
  max-width: 40ch;
  margin-bottom: 32px;
  color: #637068;
  line-height: 1.55;
}

.habit-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 750;
}

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

input[type="text"],
input:not([type]) {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #c8cec9;
  border-radius: 14px;
  background: white;
  color: #1f2b25;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(189, 91, 55, 0.28);
  outline-offset: 2px;
}

.habit-form button {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: #1f2b25;
  color: white;
  font-weight: 750;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.limit-text {
  display: block;
  margin-top: 8px;
  color: #7d8780;
  font-size: 0.8rem;
  text-align: right;
}

.habit-section {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid #e5e2da;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

#progress-text {
  color: #637068;
  font-size: 0.85rem;
}

progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e8e5dd;
}

progress::-webkit-progress-bar {
  background: #e8e5dd;
}

progress::-webkit-progress-value {
  background: #bd5b37;
}

progress::-moz-progress-bar {
  background: #bd5b37;
}

.empty-state {
  margin: 22px 0 4px;
  padding: 22px;
  border: 1px dashed #cbd0cb;
  border-radius: 16px;
  color: #6e7972;
  text-align: center;
}

.habit-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.habit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #ece9e2;
}

.habit input {
  width: 21px;
  height: 21px;
  accent-color: #bd5b37;
}

.habit-name {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.habit.is-complete .habit-name {
  color: #8a938d;
  text-decoration: line-through;
}

.delete-button {
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: #9a4930;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  body {
    padding: 12px;
    place-items: start center;
  }

  .app-shell {
    padding: 24px 20px;
    border-radius: 22px;
  }

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