:root {
  color-scheme: light;
  --ink: #24312c;
  --muted: #66736d;
  --paper: #fffaf2;
  --surface: #ffffff;
  --line: #e3ded3;
  --moss: #4f6a56;
  --fern: #2f5945;
  --rust: #b35b32;
  --amber: #d8983f;
  --gold: #c7a451;
  --shadow: 0 12px 28px rgba(43, 39, 30, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f5efe5; }
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,250,242,.94), rgba(239,244,235,.92)),
    #f5efe5;
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 520px); margin: 0 auto; min-height: 100vh; background: var(--paper); }

.hero {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  background: #2c332f;
}
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 20, .18), rgba(22, 30, 25, .42) 42%, rgba(17, 24, 20, .78));
}
.hero-content {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 22px;
  color: #fff8ec;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(32px, 10vw, 44px); line-height: .96; letter-spacing: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-meta span {
  border: 1px solid rgba(255,255,255,.36);
  background: rgba(255,255,255,.13);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

main { padding: 14px 14px 88px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: -38px; position: relative; z-index: 2; }
.stat-grid article {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(227,222,211,.9);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 12px 10px;
  min-width: 0;
}
.stat-grid span { display: block; font-size: 20px; line-height: 1; font-weight: 850; color: var(--fern); }
.stat-grid small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 14px -2px 12px;
  padding: 6px;
  background: rgba(255,250,242,.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  border: 0;
  border-radius: 6px;
  padding: 8px 3px;
  color: var(--muted);
  background: transparent;
  min-height: 54px;
}
.tab svg { width: 18px; height: 18px; stroke-width: 2.2; }
.tab span { font-size: 11px; font-weight: 800; line-height: 1; }
.tab.active { background: #e7efe4; color: var(--fern); }

.view { display: none; }
.view.active { display: block; }
.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
select, .cost-input, .owner-input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
}
.chip.active { background: var(--fern); border-color: var(--fern); color: #fff; }

.card-list { display: grid; gap: 10px; }
.item-card, .setup-card, .info-card, .budget-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  box-shadow: 0 5px 14px rgba(43, 39, 30, .06);
}
.item-head, .setup-head, .info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.category-label { color: var(--rust); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: 0; }
h2, h3 { margin: 4px 0 0; font-size: 17px; line-height: 1.2; letter-spacing: 0; }
.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 850;
  color: #fff;
  background: var(--moss);
  white-space: nowrap;
}
.pill.low { background: #80866f; }
.pill.medium { background: #b77d35; }
.pill.high { background: #a8472e; }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 700; }
.meta-row span { background: #f6f2ea; border-radius: 999px; padding: 6px 8px; }
.notes { margin: 10px 0 0; color: #4c5852; font-size: 13px; line-height: 1.45; }
.item-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.item-controls select { width: 100%; }
.cost-input { width: 100%; }
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffaf2;
  color: var(--fern);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  padding: 0 10px;
}
.link-button svg { width: 16px; height: 16px; }
.full { grid-column: 1 / -1; }

.budget-list { display: grid; gap: 10px; }
.budget-card header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.budget-card h3 { margin: 0; font-size: 15px; }
.budget-card strong { color: var(--fern); }
.bar { height: 9px; background: #eee8dc; border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--amber)); border-radius: inherit; }
.budget-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 750; }

.setup-card.done { background: #f3f8ef; }
.setup-toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--fern);
}
.setup-toggle svg { width: 20px; height: 20px; }
.setup-card.done .setup-toggle { background: var(--fern); color: #fff; border-color: var(--fern); }
.setup-foot { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.owner-input { width: 100%; }

.compact .info-card p { margin: 8px 0 0; font-size: 13px; line-height: 1.42; color: #4c5852; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-weight: 750; }

@media (min-width: 430px) {
  .hero { height: 300px; }
  main { padding-left: 18px; padding-right: 18px; }
  .toolbar { grid-template-columns: 1fr 150px; }
  .setup-foot { grid-template-columns: 1fr auto; align-items: center; }
}
