:root {
  --bg: #f7f5ef;
  --surface: #fffdf9;
  --text: #1f2723;
  --muted: #5b6a63;
  --primary: #1f6f4a;
  --primary-2: #2f8f62;
  --danger: #9f2d2d;
  --warn: #8a6118;
  --line: #d7dbd5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #fff 0%, var(--bg) 45%, #ebe8df 100%);
}

.app {
  max-width: 780px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

h1,
h2 {
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.stack,
.row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.stack {
  flex-direction: column;
}

input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 16px;
  background: #fff;
}

.row input:first-child {
  flex: 1;
}

.row input:nth-child(2) {
  width: 85px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
}

.btn-alt {
  background: #355a87;
}

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

.btn-warn {
  background: var(--warn);
}

.subtitle {
  color: var(--muted);
  margin-bottom: 8px;
}

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

.item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.item button {
  border: 0;
  background: none;
  color: var(--danger);
  font-weight: 700;
}

.bought {
  text-decoration: line-through;
  color: var(--muted);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: sticky;
  bottom: 8px;
}

.tabs button {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
}

.tabs .active {
  background: #eef7f1;
  border-color: #98b6a5;
}

@media (max-width: 640px) {
  .row {
    flex-direction: column;
  }

  .row input:nth-child(2) {
    width: 100%;
  }
}
