:root {
  --bg: #fff9fb;
  --panel: rgba(255, 251, 250, 0.94);
  --panel-strong: #fff5d8;
  --ink: #4a3040;
  --muted: #8b6f7f;
  --line: rgba(233, 184, 194, 0.72);
  --accent: #ff7c96;
  --accent-dark: #ea5a78;
  --ok: #2d6b42;
  --warn: #8f2d21;
  --berry: #ffb4c2;
  --mint: #e3f8dd;
  --sky: #dff1ff;
  --lemon: #fff1a8;
  --shadow: 0 22px 48px rgba(173, 109, 133, 0.16);
  font-family: "Trebuchet MS", "Segoe UI", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 196, 210, 0.52), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 234, 155, 0.4), transparent 26%),
    radial-gradient(circle at 20% 80%, rgba(194, 232, 255, 0.28), transparent 22%),
    linear-gradient(180deg, #fff5f8 0%, #fffdf8 42%, var(--bg) 100%);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overscroll-behavior-y: contain;
}

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

body::before {
  top: 72px;
  right: -60px;
  background: radial-gradient(circle, rgba(255, 164, 188, 0.75), rgba(255, 164, 188, 0));
}

body::after {
  bottom: 80px;
  left: -70px;
  background: radial-gradient(circle, rgba(255, 232, 157, 0.7), rgba(255, 232, 157, 0));
}

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

button {
  border: 0;
  border-radius: 16px;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, var(--accent), #ff98ac);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(255, 124, 150, 0.22);
}

button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: white;
}

label {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.2rem 1rem 3rem;
}

.pull-indicator {
  --pull-progress: 0;
  position: fixed;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(-120% + (var(--pull-progress) * 130%)));
  z-index: 30;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 252, 255, 0.96);
  border: 1px solid rgba(241, 194, 205, 0.92);
  color: #d15d7e;
  box-shadow: 0 12px 24px rgba(173, 109, 133, 0.18);
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.pull-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.topbar,
.panel-header,
.toggle-row,
.editable-row,
.snack-card-top,
.snack-card-bottom,
.log-header,
.stat-row,
.inline-form,
.tabbar,
.action-grid,
.consumer-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.toggle-row {
  width: 100%;
}

.topbar {
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
  background:
    linear-gradient(135deg, rgba(255, 252, 255, 0.98), rgba(255, 241, 209, 0.96)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 186, 202, 0.18),
      rgba(255, 186, 202, 0.18) 12px,
      rgba(255, 255, 255, 0) 12px,
      rgba(255, 255, 255, 0) 24px
    );
  border: 1px solid rgba(241, 194, 205, 0.82);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d15d7e;
  font-size: 0.72rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
}

h2 {
  font-size: 1.25rem;
}

.hero-copy {
  font-size: 0.98rem;
  color: var(--muted);
}

.snack-parade {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.snack-sticker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(238, 194, 203, 0.85);
  box-shadow: 0 10px 18px rgba(208, 123, 145, 0.09);
  font-size: 0.88rem;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(241, 206, 215, 0.78);
  border-radius: 26px;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.auth-panel {
  max-width: 420px;
  margin: 3rem auto 0;
}

.stack {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.chip-grid button {
  min-height: 56px;
}

.tabbar {
  background: rgba(255, 250, 242, 0.82);
  border: 1px solid rgba(241, 206, 215, 0.78);
  border-radius: 24px;
  padding: 0.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 24px rgba(135, 96, 61, 0.08);
}

.tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: linear-gradient(135deg, #fffef8, #ffd7e1);
  color: var(--ink);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card-list,
.editable-list,
.simple-list,
.timeline,
.detail-summary {
  display: grid;
  gap: 0.75rem;
}

.snack-card,
.editable-row,
.log-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.94);
}

.snack-card {
  color: var(--ink);
  text-align: left;
}

.snack-card.active-stock {
  background:
    linear-gradient(135deg, rgba(255, 246, 211, 0.98), rgba(255, 241, 244, 0.98)),
    radial-gradient(circle at top right, rgba(255, 181, 124, 0.22), transparent 45%);
  border-color: #efb7b1;
}

.request-card {
  display: grid;
  gap: 0.8rem;
}

.request-note {
  color: var(--ink);
  line-height: 1.45;
}

.request-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.request-actions button {
  flex: 1;
}

.request-status.pending {
  background: #fff3c8;
  color: #9d6b00;
}

.request-status.accepted {
  background: #dff6d8;
  color: #2d6b42;
}

.request-status.rejected {
  background: #ffe3df;
  color: #8f2d21;
}

.request-resolution,
.settings-help {
  margin-top: 0.55rem;
}

.snack-name {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.35;
}

.meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #ffe0e7;
  color: #d45679;
}

.snack-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-badge.consumed {
  background: var(--mint);
  color: var(--ok);
}

.status-badge.discarded {
  background: #ffe3df;
  color: var(--warn);
}

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

.hidden {
  display: none !important;
}

.modal {
  width: min(640px, calc(100vw - 1rem));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(47, 36, 25, 0.35);
}

.modal-card {
  background:
    linear-gradient(180deg, rgba(255, 252, 250, 0.99), rgba(255, 244, 238, 0.98));
  border-radius: 28px;
  padding: 1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.85rem;
}

.modal-card.large {
  max-height: 80vh;
  overflow: auto;
}

.two-column,
.stats-grid,
.stats-columns {
  display: grid;
  gap: 0.75rem;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1rem 0;
}

.stats-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.stat-box {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 236, 241, 0.98));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.9rem;
}

.stat-box strong {
  font-size: 1.4rem;
  display: block;
  margin-top: 0.2rem;
}

.stat-detail-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-align: left;
}

.panel > .toggle-row {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 240, 228, 0.98));
}

.panel > .toggle-row > span {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.panel > .toggle-row input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.editable-row .toggle-row {
  width: auto;
  gap: 0.5rem;
  justify-content: flex-end;
}

.editable-row .toggle-row span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.timeline {
  margin-top: 0.5rem;
}

.log-card {
  background: #fff;
}

.consumer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.consumer-chip {
  background: #eef2e5;
  color: var(--ok);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.82rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: rgba(47, 36, 25, 0.9);
  color: white;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  z-index: 30;
}

@media (max-width: 720px) {
  .stats-grid,
  .stats-columns,
  .two-column,
  .chip-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .inline-form,
  .toggle-row,
  .consumer-row,
  .action-grid {
    align-items: stretch;
    flex-direction: column;
  }

  .tabbar {
    position: sticky;
    top: 0.75rem;
    z-index: 2;
    backdrop-filter: blur(10px);
  }

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

}
