:root {
  --bg-start: #f8fbff;
  --bg-end: #e5eefc;
  --glow: rgba(56, 189, 248, 0.28);
  --card: #ffffff;
  --ink: #0f172a;
  --ink-soft: #51607a;
  --edge: #d8e2f2;
  --brand: #0369a1;
  --brand-strong: #0c4a6e;
  --brand-soft: rgba(3, 105, 161, 0.12);
  --danger: #be123c;
  --danger-soft: rgba(190, 18, 60, 0.1);
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-start), var(--bg-end));
  padding: clamp(14px, 2vw, 24px);
}

.background-glow {
  position: fixed;
  top: -130px;
  right: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--glow);
  filter: blur(52px);
  z-index: -1;
}

.app-shell {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow);
}

.hero,
.panel {
  padding: clamp(16px, 3vw, 28px);
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand);
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.stat-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  background: #f9fcff;
  padding: 12px;
}

.stat h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.stat p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.panel-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.habit-form {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 10px;
}

input[type="text"] {
  border: 1.5px solid var(--edge);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: inherit;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.habit-form button,
.toggle-btn {
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.habit-form button:hover,
.toggle-btn:hover {
  background: var(--brand-strong);
}

.habit-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.habit-item {
  border: 1px solid var(--edge);
  border-radius: var(--radius-md);
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.habit-item.completed {
  background: var(--brand-soft);
  border-color: rgba(3, 105, 161, 0.35);
}

.habit-name {
  margin: 0;
  font-weight: 700;
}

.habit-meta {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.delete-btn {
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--danger);
  background: transparent;
  font-weight: 700;
}

.delete-btn:hover {
  background: var(--danger-soft);
}

.empty-state {
  margin: 14px 0 0;
  border: 1px dashed var(--edge);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  color: var(--ink-soft);
}

.empty-state.hidden {
  display: none;
}

.deploy-note p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.build-stamp {
  font-size: 0.85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

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

  .habit-item {
    grid-template-columns: 1fr auto;
  }

  .toggle-btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
