:root {
  color-scheme: light;
  --bg: #f6f5f3;
  --panel: #ffffff;
  --ink: #1f1f1f;
  --muted: #6e6e6e;
  --accent: #8c5b3e;
  --accent-dark: #6d4430;
  --line: #e7e4df;
  --shadow: 0 8px 24px rgba(24, 24, 24, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.background {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(245, 242, 237, 0.9), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(248, 246, 242, 0.9), transparent 60%),
    linear-gradient(120deg, #f6f5f3 0%, #f2efea 45%, #f8f7f4 100%);
  z-index: -1;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid;
  gap: 20px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hero-head {
  display: grid;
  gap: 8px;
  align-items: start;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(20px, 3vw, 30px);
}

.subtitle {
  color: var(--muted);
  margin-top: 6px;
  max-width: 520px;
  font-size: 14px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
}

.summary strong {
  display: block;
  font-size: 15px;
  margin-top: 2px;
}

.label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary > div {
  padding: 6px 10px;
  border-radius: 10px;
  background: #fbfaf8;
  border: 1px solid var(--line);
  min-width: 140px;
}

.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

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

.panel-collapsible {
  padding: 0;
}

.panel-collapsible > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px;
}

.panel-collapsible > summary::-webkit-details-marker {
  display: none;
}

.panel-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-action {
  margin: 0;
}

.link-danger {
  background: transparent;
  border: 0;
  padding: 0;
  color: #b34d39;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  opacity: 0.7;
}

.link-danger:hover {
  opacity: 1;
}

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

.toggle-indicator {
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.panel-collapsible[open] .toggle-indicator {
  transform: rotate(45deg);
}

.panel-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.panel-collapsible[open] > summary {
  border-bottom: 1px solid var(--line);
}

.pill {
  background: #f3eee7;
  color: var(--accent-dark);
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.inline-form,
.item-form {
  display: grid;
  gap: 12px;
}

.category-add-btn {
  background: #f3eee7;
  color: var(--accent-dark);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  width: fit-content;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.item-form {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: center;
  background: #fbfaf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #ffffff;
}

select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #ffffff;
  color: var(--ink);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

select:focus {
  outline: none;
  border-color: #d5cec5;
  box-shadow: 0 0 0 3px rgba(140, 91, 62, 0.12);
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(140, 91, 62, 0.18);
}

button.ghost {
  background: #f3eee7;
  color: var(--accent-dark);
}

button.danger {
  background: #d15c45;
}

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

.item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.item.done {
  opacity: 0.7;
  background: #f6f4f1;
}

.item-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.price {
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 8px;
}

.chip {
  background: #f6f1ea;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.empty {
  color: var(--muted);
}

@media (min-width: 900px) {
  .hero {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
