:root {
  color-scheme: light;
  --cream: #fff8f3;
  --paper: rgba(255, 255, 255, 0.78);
  --paper-strong: #ffffff;
  --peach: #ff9588;
  --rose: #de4251;
  --butter: #ffd66b;
  --mint: #78a985;
  --cocoa: #4d3026;
  --muted: rgba(77, 48, 38, 0.64);
  --line: rgba(77, 48, 38, 0.10);
  --shadow: 0 12px 30px rgba(77, 48, 38, 0.10);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 214, 107, 0.22), transparent 32%),
    radial-gradient(circle at 96% 8%, rgba(120, 169, 133, 0.18), transparent 24%),
    var(--cream);
  color: var(--cocoa);
}

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

button {
  border: 0;
}

.app {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(84px, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 12px;
  background: linear-gradient(to bottom, var(--cream) 72%, rgba(255, 248, 243, 0));
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.title-block {
  min-width: 0;
  flex: 1;
}

.title-block h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.title-block p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 62px;
  justify-content: center;
  padding: 9px 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--rose);
  font-weight: 800;
}

.heart-mark {
  font-weight: 900;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(calc(100% - 28px), 492px);
  padding: 6px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tab {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 46px;
  color: var(--muted);
  background: transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.tab.active {
  color: #fff;
  background: var(--rose);
}

.toolbar {
  display: flex;
  gap: 8px;
  margin: 8px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--cocoa);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 16px rgba(77, 48, 38, 0.06);
  font-weight: 800;
}

.chip.active {
  color: #fff;
  background: var(--rose);
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-title.compact {
  margin: 0;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.dish-cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 149, 136, 0.24), rgba(255, 214, 107, 0.28), rgba(255, 255, 255, 0.68));
}

.dish-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-cover span {
  font-size: 38px;
  font-weight: 900;
  color: rgba(222, 66, 81, 0.76);
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 13px;
}

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

.row.between {
  justify-content: space-between;
}

.grow {
  min-width: 0;
  flex: 1;
}

.dish-name {
  margin: 0;
  font-size: 18px;
  line-height: 1.22;
}

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

.small {
  font-size: 12px;
}

.price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--rose);
  background: rgba(222, 66, 81, 0.10);
  font-weight: 900;
}

.status {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--rose);
  background: rgba(222, 66, 81, 0.10);
  font-size: 12px;
  font-weight: 800;
}

.status.cancelled {
  color: #777;
  background: rgba(0, 0, 0, 0.08);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--rose);
  font-weight: 850;
}

.button.secondary {
  color: var(--cocoa);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.button.danger {
  color: #fff;
  background: #9f3a3a;
}

.button:disabled {
  opacity: 0.45;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--rose);
  background: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  font-weight: 900;
}

.field,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--cocoa);
  background: rgba(255, 255, 255, 0.86);
  outline: 0;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 26px 14px;
}

.login-panel {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.login-panel .brand-icon {
  width: 72px;
  height: 72px;
}

.login-panel h1 {
  margin: 14px 0 6px;
  font-size: 28px;
}

.login-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.detail-hero {
  height: 260px;
  border-radius: 8px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 12px;
  background: rgba(77, 48, 38, 0.28);
}

.sheet-panel {
  width: min(100%, 520px);
  max-height: 92vh;
  overflow: auto;
  border-radius: 8px;
  background: var(--cream);
  box-shadow: 0 24px 80px rgba(77, 48, 38, 0.25);
}

.sheet-content {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.notice {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
}

.transaction,
.order-line,
.category-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.transaction:last-child,
.order-line:last-child,
.category-line:last-child {
  border-bottom: 0;
}

.amount.plus {
  color: var(--mint);
}

.amount.minus {
  color: var(--rose);
}

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

.mood-choice {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cocoa);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.mood-choice.active {
  color: #fff;
  background: var(--rose);
  border-color: transparent;
}

.mood-card {
  margin-top: 12px;
}

.mood-label {
  color: var(--rose);
  font-size: 26px;
  line-height: 1.15;
}

.mood-note {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--cocoa);
  background: rgba(255, 214, 107, 0.18);
}

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  .app {
    padding-top: 24px;
  }

  .grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}
