:root {
  --bg: #050505;
  --bg-2: #0b0b0d;
  --surface: rgba(18, 18, 22, 0.92);
  --surface-2: rgba(24, 24, 30, 0.94);
  --text: #f5f7fb;
  --muted: #a7acbb;
  --border: rgba(255, 255, 255, 0.1);
  --pink: #ff2fb3;
  --pink-soft: rgba(255, 47, 179, 0.14);
  --lime: #d7ff3f;
  --lime-soft: rgba(215, 255, 63, 0.12);
  --cyan: #21f1ff;
  --cyan-soft: rgba(33, 241, 255, 0.14);
  --slate-soft: rgba(255, 255, 255, 0.06);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  min-height: 100%;
  background: var(--bg);
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  position: relative;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at top left, rgba(255, 47, 179, 0.2), transparent 28%),
    radial-gradient(circle at top right, rgba(33, 241, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #09090a 0%, var(--bg) 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 12px max(28px, env(safe-area-inset-bottom));
  touch-action: pan-y;
}

.hero,
.card,
.day-card {
  position: relative;
  overflow: hidden;
}

.hero {
  background:
    linear-gradient(135deg, rgba(255, 47, 179, 0.16), transparent 40%),
    linear-gradient(160deg, rgba(33, 241, 255, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(17, 17, 19, 0.98), rgba(9, 9, 11, 0.98));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto -10% -35% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(215, 255, 63, 0.22), transparent 65%);
  pointer-events: none;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: 31px;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  filter: drop-shadow(0 0 14px rgba(33, 241, 255, 0.14));
}

.brand-tag {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(245, 247, 251, 0.62);
}

.sub {
  margin: 0;
  max-width: 32rem;
  line-height: 1.5;
  color: rgba(245, 247, 251, 0.82);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.week-switch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.week-status {
  min-width: 0;
  text-align: center;
  padding: 12px 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.week-label {
  margin: 4px 0;
  font-size: 20px;
  line-height: 1.1;
}

.week-range,
.week-hint {
  margin: 0;
}

.week-hint {
  margin-top: 10px;
  color: rgba(245, 247, 251, 0.72);
}

.week-nav-btn {
  min-height: 42px;
  white-space: nowrap;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 800;
  color: var(--lime);
}

.eyebrow.dark {
  color: var(--cyan);
}

.card,
.day-card {
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.95), rgba(12, 12, 15, 0.95));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card {
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.section-head,
.shopping-head,
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.save-hint,
.hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.summary ul {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.7;
  color: #e6e8ef;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.stat-card:nth-child(1) strong { color: var(--lime); }
.stat-card:nth-child(2) strong { color: var(--pink); }
.stat-card:nth-child(3) strong { color: var(--cyan); }

.stat-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.days {
  display: grid;
  gap: 12px;
}

.day-card {
  padding: 15px;
}

.day-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 800;
  color: var(--lime);
}

.day-title {
  margin: 10px 0 8px;
  font-size: 21px;
  line-height: 1.15;
}

.day-desc {
  margin: 0;
  color: #d3d8e4;
  line-height: 1.52;
}

.state-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid transparent;
}

.state-pill.fixed,
.badge {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: rgba(33, 241, 255, 0.24);
}

.state-pill.alt {
  background: var(--pink-soft);
  color: #ff8cd7;
  border-color: rgba(255, 47, 179, 0.22);
}

.state-pill.none {
  background: rgba(255, 255, 255, 0.06);
  color: #d0d5df;
  border-color: rgba(255, 255, 255, 0.1);
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.feedback-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feedback-label,
.feedback-note {
  margin: 0;
}

.feedback-label {
  font-size: 12px;
  font-weight: 700;
  color: #dce2ef;
}

.feedback-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.feedback-reasons {
  margin-top: 10px;
}

.feedback-subtitle {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

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

.feedback-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f5fb;
  padding: 9px 10px;
  min-height: 40px;
}

.feedback-btn.love {
  color: var(--lime);
  border-color: rgba(215, 255, 63, 0.16);
  background: rgba(215, 255, 63, 0.05);
}

.feedback-btn.okay {
  color: var(--cyan);
  border-color: rgba(33, 241, 255, 0.16);
  background: rgba(33, 241, 255, 0.05);
}

.feedback-btn.nope {
  color: #ff8cd7;
  border-color: rgba(255, 47, 179, 0.18);
  background: rgba(255, 47, 179, 0.05);
}

.feedback-btn.active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 18px rgba(255, 255, 255, 0.06);
}

.feedback-btn.love.active {
  box-shadow: 0 0 0 1px rgba(215, 255, 63, 0.22), 0 0 18px rgba(215, 255, 63, 0.14);
}

.feedback-btn.okay.active {
  box-shadow: 0 0 0 1px rgba(33, 241, 255, 0.22), 0 0 18px rgba(33, 241, 255, 0.14);
}

.feedback-btn.nope.active {
  box-shadow: 0 0 0 1px rgba(255, 47, 179, 0.22), 0 0 18px rgba(255, 47, 179, 0.14);
}

.reason-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #dfe5f0;
  padding: 7px 11px;
  min-height: 34px;
  font-size: 12px;
}

.reason-chip.active {
  color: var(--cyan);
  border-color: rgba(33, 241, 255, 0.22);
  background: rgba(33, 241, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(33, 241, 255, 0.12), 0 0 14px rgba(33, 241, 255, 0.08);
}

button {
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:active {
  transform: scale(0.98);
}

.action-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f5fb;
  padding: 9px 10px;
  min-height: 40px;
}

.action-btn.primary {
  color: var(--lime);
  border-color: rgba(215, 255, 63, 0.18);
  background: rgba(215, 255, 63, 0.06);
}

.action-btn.warn {
  color: #ff8cd7;
  border-color: rgba(255, 47, 179, 0.2);
  background: rgba(255, 47, 179, 0.06);
}

.action-btn.neutral {
  color: #d9deea;
}

.action-btn.active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 18px rgba(255, 255, 255, 0.06);
}

.action-btn.primary.active {
  box-shadow: 0 0 0 1px rgba(215, 255, 63, 0.22), 0 0 18px rgba(215, 255, 63, 0.14);
}

.action-btn.warn.active {
  box-shadow: 0 0 0 1px rgba(255, 47, 179, 0.22), 0 0 18px rgba(255, 47, 179, 0.14);
}

button.secondary,
button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f7fb;
  padding-inline: 14px;
}

button.secondary.accent {
  color: var(--lime);
  border-color: rgba(215, 255, 63, 0.2);
  background: rgba(215, 255, 63, 0.08);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

button.secondary:hover,
button.ghost:hover,
.action-btn:hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.shopping-head {
  margin-bottom: 8px;
}

.shopping-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shopping-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

#bringSyncHint {
  margin-top: 6px;
}

.shopping-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #eef2f8;
}

.shopping-list li:last-child {
  border-bottom: 0;
}

.shopping-list .empty {
  color: var(--muted);
  display: block;
}

.shopping-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  box-shadow: 0 0 10px rgba(33, 241, 255, 0.3);
  flex: 0 0 9px;
}

.day-card.fixed {
  border-color: rgba(33, 241, 255, 0.18);
}

.day-card.alt {
  border-color: rgba(255, 47, 179, 0.18);
}

.day-card.none {
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 470px) {
  .hero h1 {
    font-size: 28px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .week-switch {
    grid-template-columns: 1fr;
  }

  .week-status {
    order: -1;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .section-head,
  .shopping-head,
  .card-top {
    flex-direction: column;
  }

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

  .action-btn {
    font-size: 12px;
    padding: 9px 8px;
  }

  .feedback-btn {
    font-size: 12px;
    padding: 9px 8px;
  }
}

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