:root {
  --app-height: 100vh;
  --bg: #f3f1ec;
  --card: #ffffff;
  --text: #1b1d1f;
  --muted: #6e7279;
  --line: #dcdfe5;
  --accent: #0c7a6c;
  --accent-soft: #dff3ee;
  --danger: #b3261e;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 0%, #fbf8ef 0%, transparent 38%),
    radial-gradient(circle at 92% 6%, #e6f2f4 0%, transparent 26%),
    var(--bg);
}

.app {
  min-height: var(--app-height);
  max-width: 760px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 28px;
}

#mode-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
}

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

.status {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

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

.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.value {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
}

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

.panel {
  display: none;
}

.panel.active {
  display: block;
}

label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 4px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 11px;
}

.inline {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #064e44;
}

.btn.danger {
  color: var(--danger);
  border-color: #f0c8c8;
  background: #fff4f3;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  text-align: left;
}

.list-row.static {
  cursor: default;
}

.list-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.list-delete {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.success {
  margin: 8px 0 0;
  color: #0f6b3f;
  font-size: 12px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 560px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr;
  }
}
