:root {
  color-scheme: dark;
  --bg: #120f0d;
  --bg-deep: #0a0807;
  --panel: rgba(35, 28, 24, .78);
  --panel-strong: #241c18;
  --text: #fff8ef;
  --muted: #b8aa9d;
  --line: rgba(255,255,255,.08);
  --accent: #ffb35c;
  --accent-2: #ff7849;
  --success: #7fd1a4;
  --danger: #ff756e;
  --shadow: 0 18px 55px rgba(0,0,0,.38);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: Inter, "SF Pro Display", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4eee7;
  --bg-deep: #e9dfd4;
  --panel: rgba(255,255,255,.78);
  --panel-strong: #fffaf4;
  --text: #2b211c;
  --muted: #7d6f65;
  --line: rgba(43,33,28,.09);
  --shadow: 0 18px 55px rgba(83,56,37,.15);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,179,92,.13), transparent 32%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  color: var(--text);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
  pointer-events: none;
}
.ambient-a { background: var(--accent); top: -120px; right: -90px; }
.ambient-b { background: var(--accent-2); bottom: 8%; left: -160px; }

.app-shell {
  width: min(100%, 680px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 18px calc(env(safe-area-inset-bottom) + 48px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.eyebrow, .section-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
}
h1 { margin: 0; font-size: 27px; letter-spacing: -.04em; }
.icon-button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 190px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255,255,255,.07), transparent 48%),
    linear-gradient(135deg, rgba(255,179,92,.18), rgba(255,120,73,.05)),
    var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 170px; height: 170px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
  right: -70px; bottom: -110px;
}
.date-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.hero-card h2 {
  margin: 0;
  font-size: clamp(27px, 7vw, 37px);
  line-height: 1.1;
  letter-spacing: -.055em;
}
.hero-card p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.hero-ring {
  flex: 0 0 102px;
  height: 102px;
  padding: 8px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent-2), rgba(255,255,255,.08) 76%);
  box-shadow: 0 0 34px rgba(255,150,74,.18);
}
.ring-inner {
  width: 100%; height: 100%;
  display: grid; place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--panel-strong);
}
.ring-inner span { font-size: 32px; font-weight: 900; line-height: 1; }
.ring-inner small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .18em; }

.quick-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}
.input-wrap {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 34px rgba(0,0,0,.18);
}
.input-mark { color: var(--accent); font-size: 24px; margin-right: 10px; }
#dishInput {
  width: 100%;
  border: 0; outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  font-weight: 700;
}
#dishInput::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.add-button {
  min-width: 82px;
  border: 0;
  border-radius: 19px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #24130a;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(255,124,55,.22);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 22px;
  overflow: hidden;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip, .sort-button, .text-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  white-space: nowrap;
}
.chip {
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.sort-button {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.list-head h3 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.text-button {
  border: 0;
  padding: 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
}

.dish-list { display: grid; gap: 10px; }
.dish-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(110deg, rgba(255,255,255,.035), transparent 48%),
    var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  animation: rise .26s ease both;
  touch-action: pan-y;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.dish-card.done { opacity: .56; }
.dish-card.done .dish-name { text-decoration: line-through; text-decoration-thickness: 2px; }
.check-button {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.check-button span {
  width: 13px; height: 13px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}
.done .check-button {
  background: color-mix(in srgb, var(--success) 18%, transparent);
}
.done .check-button span {
  border: 0;
  background: var(--success);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--panel-strong) 80%, transparent);
}
.dish-name {
  margin: 0 0 7px;
  font-size: 16px;
  letter-spacing: -.02em;
}
.dish-meta { display: flex; gap: 8px; align-items: center; }
.dish-date, .dish-status {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}
.dish-status { color: var(--accent); }
.favorite-button, .more-button {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}
.favorite-button.active { color: var(--accent); }
.more-button { font-size: 16px; letter-spacing: .06em; }
.card-menu {
  position: absolute;
  z-index: 5;
  right: 12px;
  top: 58px;
  width: 148px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.card-menu button {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.card-menu button:active { background: rgba(255,255,255,.06); }
.card-menu .danger { color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 42px 12px 16px;
  color: var(--muted);
}
.empty-plate {
  width: 82px; height: 82px;
  display: grid; place-content: center;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 12px rgba(255,255,255,.025);
  color: var(--accent);
  font-size: 24px;
}
.empty-state h3 { margin: 0 0 6px; color: var(--text); }
.empty-state p { margin: 0; font-size: 13px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 800;
  transition: .22s ease;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .hero-card { padding: 22px 20px; }
  .hero-ring { flex-basis: 86px; height: 86px; }
  .ring-inner span { font-size: 27px; }
}
