:root {
  --bg: #f7f2e8;
  --bg-accent: #f0d6a8;
  --card: rgba(255, 252, 247, 0.82);
  --card-strong: #fffaf2;
  --text: #1f1b16;
  --muted: #645a4e;
  --line: rgba(53, 41, 26, 0.12);
  --accent: #bd6b2d;
  --accent-deep: #7e3d12;
  --accent-soft: #ffe7c8;
  --success: #1f7a57;
  --shadow: 0 24px 60px rgba(78, 49, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(240, 214, 168, 0.95), transparent 30%),
    radial-gradient(circle at top right, rgba(189, 107, 45, 0.18), transparent 18%),
    linear-gradient(180deg, #fcf6ee 0%, var(--bg) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(10px);
  z-index: -1;
  opacity: 0.55;
}

body::before {
  top: 5%;
  right: -80px;
  background: rgba(255, 183, 114, 0.5);
}

body::after {
  bottom: 10%;
  left: -110px;
  background: rgba(110, 166, 124, 0.28);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  border-radius: 32px;
  animation: rise-in 0.7s ease both;
}

.hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.eyebrow,
.section-tag,
.panel-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent-deep);
}

.hero-copy h1,
.section-heading h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.05;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 4vw, 4.4rem);
  max-width: 12ch;
}

.hero-text {
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  margin: 20px 0 26px;
}

.sync-pill,
.hero-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.sync-pill {
  color: var(--accent-deep);
  background: rgba(255, 237, 209, 0.92);
  border: 1px solid rgba(126, 61, 18, 0.12);
}

.hero-note {
  margin: -6px 0 22px;
  color: var(--accent-deep);
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span,
.summary-label,
.history-note,
.history-date {
  color: var(--muted);
}

.hero-badges span {
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255, 241, 219, 0.92);
  border: 1px solid rgba(126, 61, 18, 0.1);
}

.hero-panel {
  padding: 30px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  animation: rise-in 0.7s ease 0.1s both;
}

.hero-panel-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hero-goal-title {
  display: block;
  position: relative;
  max-width: 16ch;
  font-size: 1.1rem;
  line-height: 1.4;
}

.hero-status-chip {
  position: relative;
  color: #fffaf2;
  background: linear-gradient(135deg, rgba(189, 107, 45, 0.96), rgba(126, 61, 18, 0.96));
  box-shadow: 0 10px 24px rgba(126, 61, 18, 0.16);
}

.hero-panel::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -70px;
  right: -40px;
  border-radius: 50%;
  background: rgba(255, 224, 180, 0.5);
}

.hero-amount {
  position: relative;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.5rem, 3vw, 3.3rem);
  margin-top: 14px;
}

.hero-subtitle {
  position: relative;
  margin: 10px 0 22px;
  color: var(--muted);
}

.hero-progress-track,
.progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(189, 107, 45, 0.14);
  overflow: hidden;
}

.hero-progress-bar,
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4b460 0%, #bd6b2d 55%, #8b451c 100%);
  transition: width 0.35s ease;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.hero-meta span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-meta strong,
.progress-copy strong,
.summary-item strong,
.insight-list strong,
.history-amount {
  font-size: 1.15rem;
}

.hero-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.hero-quick-item {
  position: relative;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid rgba(53, 41, 26, 0.08);
}

.hero-quick-item span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-quick-item strong {
  line-height: 1.4;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.card {
  padding: 28px;
  border-radius: 28px;
  animation: rise-in 0.7s ease both;
}

.card-form,
.card-summary,
.card-insights {
  grid-column: span 6;
}

.card-storage,
.card-history {
  grid-column: 1 / -1;
}

.card:nth-of-type(1) {
  animation-delay: 0.18s;
}

.card:nth-of-type(2) {
  animation-delay: 0.24s;
}

.card:nth-of-type(3) {
  animation-delay: 0.3s;
}

.card:nth-of-type(4) {
  animation-delay: 0.36s;
}

.card:nth-of-type(5) {
  animation-delay: 0.42s;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.96rem;
}

.full-width {
  grid-column: 1 / -1;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: rgba(189, 107, 45, 0.68);
  box-shadow: 0 0 0 4px rgba(189, 107, 45, 0.12);
  transform: translateY(-1px);
}

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

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

.primary-btn,
.secondary-btn,
.upload-btn,
.delete-btn {
  border-radius: 16px;
  padding: 14px 18px;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.upload-btn:hover,
.delete-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fffdf9;
  box-shadow: 0 14px 28px rgba(126, 61, 18, 0.2);
}

.secondary-btn {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 250, 242, 0.92);
  color: var(--accent-deep);
  border: 1px dashed rgba(126, 61, 18, 0.22);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.delete-btn:disabled {
  transform: none;
  opacity: 0.5;
  box-shadow: none;
}

.delete-btn {
  background: rgba(189, 107, 45, 0.12);
  color: var(--accent-deep);
  padding-inline: 16px;
}

.form-grid button {
  grid-column: 1 / -1;
  width: 100%;
}

.summary-grid,
.insight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-item,
.insight-list article {
  padding: 18px;
  border-radius: 22px;
  background: var(--card-strong);
  border: 1px solid rgba(53, 41, 26, 0.08);
}

.summary-item strong,
.progress-copy strong,
.insight-list strong {
  display: block;
  margin-top: 10px;
}

.insight-list article:last-child {
  grid-column: 1 / -1;
}

.progress-card {
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 241, 219, 0.95), rgba(255, 247, 235, 0.85));
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 14px;
}

.insight {
  margin: 14px 0 0;
  line-height: 1.65;
  color: var(--muted);
}

.card-storage {
  background:
    linear-gradient(135deg, rgba(255, 248, 236, 0.92), rgba(255, 252, 247, 0.84)),
    var(--card);
}

.storage-status-box {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 238, 212, 0.94), rgba(255, 249, 240, 0.96));
  border: 1px solid rgba(126, 61, 18, 0.08);
}

.storage-status-box strong {
  display: block;
  font-size: 1.12rem;
}

.storage-status-box p,
.storage-helper {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.storage-meta article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid rgba(53, 41, 26, 0.08);
}

.storage-meta strong {
  display: block;
  margin-top: 10px;
}

.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.storage-actions > * {
  flex: 1 1 220px;
}

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

.history-list {
  display: grid;
  gap: 14px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.92);
  border: 1px solid rgba(53, 41, 26, 0.08);
}

.history-item strong {
  display: block;
  margin: 6px 0;
}

.history-note,
.empty-state,
.hero-subtitle,
.insight,
.summary-label {
  line-height: 1.6;
}

.empty-state {
  margin: 0;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.88);
  color: var(--muted);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .card-form,
  .card-summary,
  .card-insights,
  .card-history {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 16px, 1180px);
    padding: 16px 0 34px;
  }

  .hero-copy,
  .hero-panel,
  .card {
    padding: 22px;
    border-radius: 24px;
  }

  .hero-copy h1 {
    font-size: clamp(2.15rem, 11vw, 3.1rem);
    max-width: 9ch;
  }

  .hero-topline,
  .hero-panel-head,
  .progress-copy,
  .storage-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sync-pill,
  .hero-status-chip {
    width: fit-content;
    max-width: 100%;
  }

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

  .hero-badges span {
    text-align: center;
  }

  .form-grid,
  .summary-grid,
  .insight-list,
  .hero-meta,
  .hero-quick-grid,
  .storage-meta {
    grid-template-columns: 1fr;
  }

  .history-item {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-note {
    margin-bottom: 20px;
  }

  .hero-amount {
    font-size: 2.3rem;
  }

  .delete-btn {
    width: 100%;
  }
}
