:root {
  --primary: #b84f36;
  --primary-dark: #9c3f2a;
  --secondary: #f4e7d2;
  --cream-card: #fdf6ea;
  --accent: #d79a2b;
  --iron: #33281e;
  --iron-deep: #241b13;
  --ink: #3b2f26;
  --ink-soft: #7a6a58;
  --line: #d8c5a0;
  --wood: #a9743c;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #f3e7d0 0%, #ecdcbe 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + var(--safe-bottom));
}

h1, h2, h3, p, fieldset, legend {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
.chip:focus-visible {
  outline: 3px solid rgba(184, 79, 54, 0.45);
  outline-offset: 2px;
}

svg { display: block; }

.noscript-note {
  padding: 20px;
  text-align: center;
  font-weight: 700;
}

.hood {
  background: linear-gradient(180deg, #2f251b, #241c13);
  color: var(--secondary);
  border-bottom: 3px solid #17110b;
  box-shadow: 0 4px 14px rgba(43, 32, 22, 0.28);
}

.hood::before {
  content: "";
  display: block;
  height: 8px;
  background: repeating-linear-gradient(90deg, #17110b 0 10px, #262019 10px 20px);
  opacity: 0.85;
}

.hood-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px 16px;
}

.hood-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--secondary);
}

.brand-icon { width: 27px; height: 27px; flex: none; }

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.spoon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #b98a4e, #96662f);
  color: var(--cream-card);
  border: 1px solid #6f4a20;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 5px rgba(0, 0, 0, 0.3);
  min-height: 44px;
}

.spoon-btn:active { transform: translateY(1px); }

.spoon-btn svg { width: 15px; height: 15px; flex: none; }

.hood-dials {
  display: flex;
  gap: 18px;
  margin-top: 14px;
}

.dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.dial-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fdf6ea, #e7d3ae);
  color: #6b4a2f;
  font-size: 20px;
  font-weight: 800;
  box-shadow:
    inset 0 -3px 6px rgba(0, 0, 0, 0.28),
    inset 0 3px 5px rgba(255, 255, 255, 0.85),
    0 2px 5px rgba(0, 0, 0, 0.45);
}

.dial-face::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  margin-left: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(107, 74, 47, 0.55);
}

.dial-cooked .dial-face {
  color: #a2671f;
  background: radial-gradient(circle at 35% 30%, #fff0cf, #eed9a6);
}

.dial-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 231, 210, 0.78);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 14px 10px;
}

.view-head { margin-bottom: 16px; }

.eyebrow {
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a2671f;
}

.view-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.view-sub {
  font-size: 13px;
  color: var(--ink-soft);
}

.today-stack { display: flex; flex-direction: column; gap: 12px; }

.skillet {
  position: relative;
  margin-right: 20px;
  background: radial-gradient(120% 110% at 50% 0%, #352a1f, #221a12);
  border-radius: 22px;
  padding: 12px;
  box-shadow:
    inset 0 0 0 2px #17100b,
    inset 0 0 0 7px #3b2e21,
    inset 0 0 0 8px #17100b,
    0 6px 18px rgba(43, 32, 22, 0.35);
}

.skillet::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 13px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, var(--wood), #7a5327);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.skillet-note {
  margin: 3px 5px 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 231, 210, 0.62);
}

.slip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  text-align: left;
  background: linear-gradient(180deg, #fdf8ec, #f6ecd8);
  border: 1px solid #e0cfae;
  border-radius: 10px 14px 14px 10px;
  padding: 10px 12px 10px 22px;
  box-shadow: 0 1px 2px rgba(59, 47, 38, 0.16);
}

.slip:active { transform: translateY(1px); }

.slip-band {
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 6px;
  border-radius: 4px;
  flex: none;
}

.slip[data-type="Breakfast"] .slip-band { background: var(--accent); }
.slip[data-type="Lunch"] .slip-band { background: var(--primary); }
.slip[data-type="Dinner"] .slip-band { background: #4a3b2e; }

.slip-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slip-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.slip-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

.slip-flag {
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9c6a15;
  background: rgba(215, 154, 43, 0.18);
  border: 1px solid rgba(215, 154, 43, 0.6);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.slip.cooked {
  background: linear-gradient(180deg, #f3e3c4, #e9d0a0);
  border-color: #c29a63;
  box-shadow: 0 1px 3px rgba(59, 47, 38, 0.2), inset 0 0 0 1px rgba(185, 138, 78, 0.3);
}

.slip.cooked .slip-title { color: #5c452c; }

.empty {
  text-align: center;
  background: #f9f1de;
  border: 1.5px dashed #cbb68e;
  border-radius: 18px;
  padding: 28px 18px;
}

.empty-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.empty .spoon-btn { margin: 0 auto; }

.burner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.burner {
  background:
    radial-gradient(90% 70% at 50% 38%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 70%),
    #2b211a;
  border-radius: 20px;
  padding: 12px;
  box-shadow:
    inset 0 0 0 2px #17110c,
    inset 0 0 0 8px #3a2d21,
    inset 0 0 0 9px #17110c;
}

.burner:last-child:nth-child(odd) { grid-column: 1 / -1; }

.burner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 3px 10px;
}

.burner-day {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--secondary);
}

.burner-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(215, 154, 43, 0.16);
  border: 1px solid rgba(215, 154, 43, 0.45);
  border-radius: 999px;
  padding: 2px 9px;
}

.burner-slips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.burner .slip { min-height: 54px; }

.burner-empty {
  color: rgba(244, 231, 210, 0.45);
  font-size: 12px;
  padding: 2px 3px;
}

.meal-form {
  background: #f9f0dd;
  border: 1.5px solid #e0cfae;
  border-radius: 20px;
  padding: 18px 14px 16px;
  box-shadow: 0 3px 10px rgba(43, 32, 22, 0.08);
}

.edit-banner {
  background: rgba(215, 154, 43, 0.16);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #7a5a20;
}

.field { margin: 0 0 16px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b5a49;
  margin-bottom: 8px;
}

legend.field-label { padding: 0; margin-bottom: 8px; }

.field-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.field-err {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.text-input {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid var(--line);
  background: var(--cream-card);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
}

.text-input::placeholder { color: #b3a288; }

.text-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184, 79, 54, 0.16);
}

.text-input.invalid {
  border-color: var(--primary);
  background: #fdf1ea;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip-row.invalid .chip { border-color: #d8a08b; }

.chip {
  flex: 1 1 auto;
  min-width: 64px;
  min-height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--cream-card);
  font-size: 14px;
  font-weight: 700;
  color: #6b5a49;
  padding: 8px 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--cream-card);
  box-shadow: 0 2px 6px rgba(184, 79, 54, 0.32);
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--cream-card);
  border: 1.5px solid #e2d2ae;
  border-radius: 14px;
  padding: 12px 14px;
}

.toggle-field .field-label { margin-bottom: 0; }

.switch { position: relative; display: inline-block; flex: none; }

.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  display: block;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: #e0cfae;
  border: 1.5px solid #cbb68e;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--cream-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s;
}

.switch input:checked + .switch-track {
  background: var(--accent);
  border-color: #b98a4e;
}

.switch input:checked + .switch-track::after { transform: translateX(24px); }

.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px rgba(184, 79, 54, 0.3);
}

.primary-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--primary);
  color: #fdf6ea;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 10px rgba(184, 79, 54, 0.35);
}

.primary-btn:active { transform: translateY(1px); }

.edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.ghost-btn {
  min-height: 48px;
  border: 1.5px solid #c9b48d;
  background: transparent;
  color: #6b5a49;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
}

.ghost-btn.danger {
  border-color: #d8a08b;
  color: var(--primary);
}

.ghost-btn.armed,
.mini-btn.armed {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--cream-card);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream-card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

.search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(184, 79, 54, 0.14);
}

.search-wrap svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: #a08a6d;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  min-height: 46px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
}

.search-wrap input:focus { outline: none; }

.search-wrap input::placeholder { color: #b3a288; }

.clear-btn {
  flex: none;
  border: 0;
  background: #e7d7b8;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b5a49;
  padding: 8px 10px;
  min-height: 36px;
}

.find-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.find-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.find-row .slip { flex: 1; }

.find-actions {
  flex: none;
  width: 88px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-btn {
  flex: 1;
  width: 100%;
  min-height: 46px;
  border: 1.5px solid #c9b48d;
  background: var(--cream-card);
  color: #6b5a49;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.mini-btn.danger {
  color: var(--primary);
  border-color: #d8a08b;
}

.about {
  margin-top: 24px;
  background: #f7edd8;
  border: 1.5px solid #e0cfae;
  border-radius: 18px;
  padding: 16px;
}

.about-title {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a2671f;
}

.about-text {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #6b5a49;
}

.about-actions {
  display: grid;
  gap: 10px;
}

.about-meta {
  margin-top: 12px;
  font-size: 11px;
  color: #9c8a70;
  text-align: center;
}

.knobbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: linear-gradient(180deg, #f7ecd7, #eeddba);
  border-top: 3px solid var(--iron);
  box-shadow: 0 -6px 16px rgba(43, 32, 22, 0.14);
  padding: 10px 8px calc(10px + var(--safe-bottom));
}

.knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  padding: 2px 0;
  min-height: 76px;
}

.knob-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #f0e3cb;
  color: #86745f;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.16),
    inset 0 -2px 3px rgba(255, 255, 255, 0.6);
  transition: transform 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
}

.knob-dial::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(134, 116, 95, 0.4);
}

.knob-dial svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s;
}

.knob-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #7a6a58;
}

.knob.active .knob-dial {
  background: var(--primary);
  color: #fdf6ea;
  transform: rotate(35deg);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.28),
    0 0 0 3px #f0dcb6,
    0 0 16px rgba(215, 154, 43, 0.6);
}

.knob.active .knob-dial::before { background: var(--accent); }

.knob.active .knob-dial svg { transform: rotate(-35deg); }

.knob.active .knob-label {
  color: var(--primary);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(112px + var(--safe-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: 60;
  max-width: 88%;
  background: var(--iron);
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 17px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 620px) {
  .hood-inner { padding-left: 24px; padding-right: 24px; }
  .app { padding-left: 24px; padding-right: 24px; }
}
