:root {
  --ink: #0F1B2D;
  --ink-2: #172841;
  --ink-3: #243A5C;
  --brass: #B08D57;
  --brass-2: #C9A874;
  --brass-soft: #F1E8D9;
  --paper: #EEF1F5;
  --surface: #FFFFFF;
  --line: #DCE2EA;
  --line-2: #E8ECF1;
  --text: #14202E;
  --muted: #5F6C7D;
  --faint: #8A95A4;
  --green: #1F6B52;
  --green-soft: #E3F1EB;
  --red: #9B2C35;
  --red-soft: #F7E6E7;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px -12px rgba(15, 27, 45, .18);
  --sidebar: 256px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- boot / login ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.boot .mark { width: 56px; height: 56px; opacity: .9; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ink); color: #fff;
}
.auth-visual { position: relative; overflow: hidden; }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.62); }
.auth-visual::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,27,45,.1) 30%, rgba(15,27,45,.92) 100%);
}
.auth-quote { position: absolute; left: 56px; right: 56px; bottom: 56px; z-index: 1; max-width: 520px; }
.auth-quote p { font: 500 40px/1.12 var(--serif); margin: 0 0 16px; letter-spacing: -.01em; }
.auth-quote span { color: var(--brass-2); font-size: 14px; }
.auth-panel { display: grid; place-items: center; padding: 48px 24px; background: var(--ink); }
.auth-card { width: 100%; max-width: 380px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand b { font: 600 22px/1 var(--serif); letter-spacing: .01em; color: #fff; }
.brand small { display: block; font-size: 11.5px; color: var(--brass-2); margin-top: 3px; letter-spacing: .02em; }
.auth-card h1 { font: 500 34px/1.1 var(--serif); margin: 48px 0 8px; }
.auth-card .lead { color: #AEB9C8; margin: 0 0 32px; }
.auth-card label { display: block; font-size: 13px; color: #C6CFDB; margin: 0 0 6px; }
.auth-card .field { margin-bottom: 18px; }
.auth-card input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid #2E4566; background: var(--ink-2); color: #fff; font-size: 16px;
}
.auth-card input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(176,141,87,.25); }
.auth-card .btn { width: 100%; height: 50px; margin-top: 8px; }
.auth-card .error { background: rgba(155,44,53,.2); border: 1px solid rgba(214,96,104,.45); color: #FFD9DC; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 18px; }
.auth-foot { margin-top: 40px; font-size: 12.5px; color: #6F7F95; }
.pw-rules { list-style: none; padding: 0; margin: -4px 0 18px; font-size: 13px; color: #8FA0B6; }
.pw-rules li { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.pw-rules li.ok { color: #9FD9C1; }
.pw-rules li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brass); color: #16110A; }
.btn-primary:hover { background: var(--brass-2); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #F0D3D6; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); flex: none;
}
.icon-btn:hover { border-color: var(--ink-3); }
.icon-btn svg { width: 18px; height: 18px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.f label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.f input, .f select, .f textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); font-size: 15px;
}
.f textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(176,141,87,.18); }
.f .hint { font-size: 12.5px; color: var(--faint); margin-top: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--ink); color: #D6DEE9;
  display: flex; flex-direction: column; padding: 26px 16px 18px; overflow-y: auto;
}
.sidebar .brand { padding: 0 10px 28px; }
.nav-group { margin-bottom: 22px; }
.nav-group h6 { margin: 0 0 8px; padding: 0 12px; font-size: 12px; font-weight: 600; color: #6F819A; letter-spacing: .02em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 600; font-size: 14.5px; color: #C3CDDA; position: relative;
}
.nav a svg { width: 19px; height: 19px; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: var(--ink-3); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass); }
.nav a.active svg { opacity: 1; color: var(--brass-2); }
.nav .count { margin-left: auto; font-size: 12px; background: var(--brass); color: #16110A; padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 14px 10px 0; border-top: 1px solid #22344F; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brass-soft); color: #6B5226; font-weight: 800; font-size: 14px;
}
.sidebar-user .avatar { background: var(--ink-3); color: var(--brass-2); }
.sidebar-user b { display: block; color: #fff; font-size: 14px; }
.sidebar-user small { color: #7D8DA3; font-size: 12px; }
.sidebar-user .icon-btn { margin-left: auto; background: transparent; border-color: #2B3F5E; color: #AEB9C8; }

.main { min-width: 0; padding: 36px 44px 64px; }
.page { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font: 600 40px/1.05 var(--serif); margin: 0; letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.back svg { width: 16px; height: 16px; }

.topbar, .tabbar { display: none; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel h2 { font: 600 24px/1.2 var(--serif); margin: 0 0 4px; }
.panel h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ---------- hero kcal ---------- */
.day {
  background: var(--ink); color: #fff; border-radius: 22px; padding: 32px; display: grid;
  grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: center; position: relative; overflow: hidden;
}
.day::after {
  content: ''; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  border: 1px solid rgba(201,168,116,.18); pointer-events: none;
}
.ring { position: relative; width: 250px; height: 250px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .num { font: 600 64px/.9 var(--serif); letter-spacing: -.02em; }
.ring .unit { color: var(--brass-2); font-size: 13px; margin-top: 8px; }
.ring .arc { transition: stroke-width .2s; cursor: pointer; }
.ring .arc:hover, .ring .arc.hl { stroke-width: 20; }
.day h2 { font: 500 34px/1.1 var(--serif); margin: 0 0 6px; }
.day .sub { color: #9EACBF; margin: 0 0 24px; }
.meal-split { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.meal-split a {
  display: block; text-decoration: none; padding: 14px 14px 12px; border-radius: 14px; background: var(--ink-2);
  border: 1px solid #22344F; transition: border-color .15s;
}
.meal-split a:hover, .meal-split a.hl { border-color: var(--brass); }
.meal-split .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.meal-split small { font-size: 12.5px; color: #AEB9C8; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-split b { font: 600 28px/1.1 var(--serif); display: block; margin-top: 6px; }
.meal-split em { font-style: normal; font-size: 12px; color: #7D8DA3; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.stat { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; display: block; }
.stat small { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat b { display: block; font: 600 36px/1.1 var(--serif); margin-top: 6px; }
.stat span { font-size: 13px; color: var(--faint); }
a.stat:hover { border-color: var(--brass); }

/* water */
.water-cups { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.cup {
  width: 38px; height: 46px; border-radius: 6px 6px 12px 12px; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; position: relative; overflow: hidden; padding: 0;
}
.cup::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #4B78A8; transition: height .25s; }
.cup.full { border-color: #4B78A8; }
.cup.full::after { height: 78%; }
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brass); border-radius: 99px; transition: width .3s; }
.progress.blue i { background: #4B78A8; }
.progress.green i { background: var(--green); }

/* ---------- plan ---------- */
.plan-tools { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search input { width: 100%; height: 44px; padding: 0 14px 0 42px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.search input:focus { outline: none; border-color: var(--brass); }
.chip {
  height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { width: 16px; height: 16px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.slot { margin-bottom: 34px; }
.slot-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.slot-head h2 { font: 600 28px/1 var(--serif); margin: 0; }
.slot-head .kcal { color: var(--brass); font-weight: 700; font-size: 14px; }
.slot-head .n { color: var(--faint); font-size: 13px; margin-left: auto; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); overflow: visible; }
.card {
  scroll-snap-align: start; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: left; padding: 0;
}
.card:hover .card-img img { transform: scale(1.03); }
.card-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card-img .fav {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(15,27,45,.72); color: #fff; border: 0; cursor: pointer;
}
.card-img .fav svg { width: 17px; height: 17px; }
.card-img .fav.on { background: var(--brass); color: #16110A; }
.card-img .opt { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.94); color: var(--ink); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: auto; font-size: 13px; color: var(--muted); }
.card-meta svg { width: 15px; height: 15px; color: var(--brass); }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 20% 10%, var(--ink-3), var(--ink));
}
.ph svg { width: 42%; height: 42%; color: rgba(201,168,116,.55); }

.notes { background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--brass); border-radius: var(--r-md); margin-bottom: 30px; }
.notes summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; font-weight: 700; }
.notes summary::-webkit-details-marker { display: none; }
.notes summary svg { width: 20px; height: 20px; color: var(--brass); }
.notes summary .chev { margin-left: auto; color: var(--faint); transition: transform .2s; }
.notes[open] summary .chev { transform: rotate(180deg); }
.notes ul { margin: 0; padding: 0 24px 20px 42px; display: grid; gap: 8px; color: #334155; max-width: 860px; }

/* ---------- drawer (receita) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(9,16,28,.55); z-index: 50; animation: fade .2s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 51;
  overflow-y: auto; animation: slidein .28s cubic-bezier(.2,.8,.2,1); box-shadow: -20px 0 60px rgba(9,16,28,.3);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-img { aspect-ratio: 16 / 10; position: relative; background: var(--ink); }
.drawer-img img { width: 100%; height: 100%; object-fit: cover; }
.drawer-img .icon-btn { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.92); border: 0; }
.drawer-img .fav { position: absolute; top: 16px; right: 64px; }
.drawer-img .fav.icon-btn.on { background: var(--brass); color: #16110A; }
.drawer-body { padding: 26px 30px 40px; }
.drawer-body .slot-tag { font-size: 13px; font-weight: 700; color: var(--brass); }
.drawer-body h2 { font: 600 32px/1.1 var(--serif); margin: 6px 0 14px; }
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; padding: 2px; cursor: pointer; color: #C9CFD8; }
.stars button svg { width: 24px; height: 24px; }
.stars button.on { color: var(--brass); }
.personal { display: flex; gap: 10px; align-items: flex-start; background: var(--brass-soft); color: #5B4520; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; margin: 16px 0 22px; }
.personal svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 12px 16px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-color: var(--brass); }
.ing { list-style: none; margin: 0; padding: 0; }
.ing li { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.ing li:last-child { border-bottom: 0; }
.ing .q { font: 600 20px/1 var(--serif); color: var(--ink); text-align: right; }
.ing .q.none { font: 500 13px/1 var(--sans); color: var(--faint); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--brass-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--brass); margin-bottom: 10px; }
.empty h3 { color: var(--text); font: 600 24px/1.2 var(--serif); margin: 0 0 6px; }

/* ---------- compras ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px; }
.seg button { border: 0; background: none; padding: 9px 20px; border-radius: 99px; font-weight: 700; cursor: pointer; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--ink); color: #fff; }
.shop-summary { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.shop-summary .big { font: 600 44px/1 var(--serif); }
.shop-summary .progress { flex: 1; min-width: 200px; }
.aisle { margin-bottom: 18px; }
.aisle h3 { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 8px; padding: 0 4px; }
.items { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; user-select: none; min-height: 58px; }
.item:last-child { border-bottom: 0; }
.item .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #B7C1CE; flex: none; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.item .box svg { width: 15px; height: 15px; color: #fff; opacity: 0; }
.item .name { flex: 1; font-weight: 600; }
.item .qty { font: 600 20px/1 var(--serif); white-space: nowrap; }
.item.done { background: #FAFBFC; }
.item.done .box { background: var(--green); border-color: var(--green); }
.item.done .box svg { opacity: 1; }
.item.done .name, .item.done .qty { color: var(--faint); text-decoration: line-through; }
.item .del { opacity: .5; }
.add-extra { display: flex; gap: 10px; margin-top: 12px; }
.add-extra input { flex: 1; height: 44px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 14px; background: var(--surface); }
.meal-pick { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.meal-pick:last-child { border-bottom: 0; }
.meal-pick img, .meal-pick .ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.meal-pick .ph svg { width: 26px; height: 26px; }
.meal-pick .t { flex: 1; min-width: 0; }
.meal-pick .t b { display: block; font-size: 14.5px; line-height: 1.35; }
.meal-pick .t small { color: var(--faint); font-size: 12.5px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--paper); border-radius: 99px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(15,27,45,.12); }
.stepper button svg { width: 16px; height: 16px; }
.stepper span { min-width: 26px; text-align: center; font-weight: 800; }
.meal-pick.zero .t { opacity: .6; }
.meal-pick.zero .stepper span { color: var(--faint); }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.link { cursor: pointer; }
table.t tr.link:hover td { background: #F8F9FB; }
.who { display: flex; align-items: center; gap: 12px; }
.who b { display: block; }
.who small { color: var(--faint); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.brass { background: var(--brass-soft); color: #6B5226; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.dark { background: var(--ink); color: #fff; }

.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row small { color: var(--faint); }

/* ---------- admin: plano / receita editor ---------- */
.editor-slot { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; background: #FBFCFD; }
.editor-slot-head { display: grid; grid-template-columns: 1fr 130px auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.opt-list { display: grid; gap: 8px; }
.opt-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; }
.opt-item img, .opt-item .ph { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; }
.opt-item .ph svg { width: 20px; height: 20px; }
.opt-item .grow { flex: 1; font-weight: 600; font-size: 14px; min-width: 0; }
.opt-item .grow small { display: block; color: var(--faint); font-weight: 500; }
.opt-item .icon-btn { width: 32px; height: 32px; }
.add-opt { display: flex; gap: 8px; margin-top: 10px; }
.add-opt select { flex: 1; min-height: 38px; border: 1px dashed var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface); }
.ing-row { display: grid; grid-template-columns: 90px 90px minmax(0, 1fr) 170px 38px; gap: 8px; margin-bottom: 8px; align-items: center; }
.ing-row input, .ing-row select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); width: 100%; }
.step-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 38px; gap: 8px; margin-bottom: 8px; align-items: start; }
.step-row span { font-weight: 800; color: var(--brass); padding-top: 10px; text-align: center; }
.step-row textarea { min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; width: 100%; }
.img-drop { aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; position: relative; background: var(--ink-2); }
.img-drop img { width: 100%; height: 100%; object-fit: cover; }
.img-drop label { position: absolute; left: 12px; bottom: 12px; }
.recipe-thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; }

/* ---------- modal / toast ---------- */
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface); border-radius: 20px; z-index: 61; padding: 28px; animation: pop .22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 30px 80px rgba(9,16,28,.35);
}
.modal.wide { width: min(760px, calc(100% - 32px)); }
.overlay.m { z-index: 60; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
.modal h2 { font: 600 28px/1.15 var(--serif); margin: 0 0 6px; }
.modal .sub { color: var(--muted); margin: 0 0 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.secret { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 14px 16px; border-radius: var(--r-md); margin: 14px 0; }
.secret code { flex: 1; font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: var(--brass-2); word-break: break-all; }
.secret .icon-btn { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px rgba(9,16,28,.3); animation: pop2 .2s; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--red); }
.toast svg { width: 18px; height: 18px; color: var(--brass-2); }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } }

/* chart */
.chart { width: 100%; height: 220px; }
.chart .grid line { stroke: var(--line-2); }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--sans); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .day { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .meal-split { width: 100%; text-align: left; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 76px 16px 104px; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: fixed; top: 0; left: 0; right: 0; height: 60px; padding: 0 16px;
    background: var(--ink); color: #fff; z-index: 40;
  }
  .topbar .brand svg { width: 30px; height: 30px; }
  .topbar .brand b { font-size: 19px; }
  .topbar .brand small { display: none; }
  .topbar .icon-btn { margin-left: auto; background: transparent; border-color: #2B3F5E; color: #D6DEE9; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 3px; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--faint); padding: 6px 0; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active svg { color: var(--brass); }
  .page-head h1 { font-size: 32px; }
  .page-head { margin-bottom: 20px; }
  .panel { padding: 18px; }
  .day { padding: 24px 18px; gap: 22px; }
  .ring { width: 210px; height: 210px; }
  .ring .num { font-size: 54px; }
  .meal-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meal-split a:last-child { grid-column: 1 / -1; }
  .stat-row { gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 30px; }
  .rail { grid-auto-columns: 74%; margin: 0 -16px; padding: 2px 16px 12px; scroll-padding: 16px; }
  .rail.wrap { margin: 0; padding: 2px 0 12px; grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .drawer { top: auto; max-height: 92vh; border-radius: 22px 22px 0 0; animation-name: slideup; }
  @keyframes slideup { from { transform: translateY(60px); opacity: 0; } }
  .drawer-body { padding: 22px 20px 40px; }
  .ing li { grid-template-columns: 70px 1fr; }
  .ing-row { grid-template-columns: 70px 70px minmax(0, 1fr) 38px; }
  .ing-row .cat { grid-column: 1 / -2; }
  .editor-slot-head { grid-template-columns: 1fr 100px auto; }
  table.t .hide-m { display: none; }
  .item { padding: 14px 14px; }
  .shop-summary .big { font-size: 36px; }
  .toasts { bottom: 88px; width: calc(100% - 32px); }
}

@media print {
  .sidebar, .topbar, .tabbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .items { box-shadow: none; }
  .item.done { display: none; }
}

/* ---------- ajustes ---------- */
.ring .num, .meal-split b, .stat b, .ing .q, .item .qty, .shop-summary .big, .page-head h1, .panel h2 { font-variant-numeric: lining-nums; }
.grid-2 > *, .grid-3 > * { min-width: 0; }
.grid-2 > .panel + .panel, .grid-3 > .panel + .panel { margin-top: 0; }
.meal-split small { white-space: normal; line-height: 1.3; min-height: 2.6em; }
.chart { height: auto; }
.more-list { display: grid; gap: 6px; margin-top: 8px; }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--paper); text-decoration: none; font-weight: 700; }
.more-list a svg { width: 20px; height: 20px; color: var(--brass); }
.tabbar button { background: none; border: 0; display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--faint); padding: 6px 0; cursor: pointer; }
.tabbar button svg { width: 22px; height: 22px; }
@media (max-width: 860px) {
  .ing-row { grid-template-columns: 90px 96px minmax(0, 1fr) 38px; grid-template-areas: "q u . x" "n n n n" "c c c c"; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #FBFCFD; }
  .ing-row > :nth-child(1) { grid-area: q; }
  .ing-row > :nth-child(2) { grid-area: u; }
  .ing-row > :nth-child(3) { grid-area: n; }
  .ing-row > :nth-child(4) { grid-area: c; }
  .ing-row > :nth-child(5) { grid-area: x; justify-self: end; }
  .editor-slot { padding: 12px; }
  .opt-item .icon-btn { width: 30px; height: 30px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .page-head .actions .seg { width: 100%; }
  .page-head .actions .seg button { flex: 1; }
  .modal { padding: 22px 18px; }
  .shop-summary .no-print { width: 100%; }
}
.tabbar button.active { color: var(--ink); } .tabbar button.active svg { color: var(--brass); }
@media (max-width: 860px) { .chart text { font-size: 20px; } }
