/* NutriFlow — sistema visual Ecozentech (Stripe + Linear, fondo profundo, naranja→rojo) */
:root {
  --bg: #020817;
  --bg-2: #0b0e13;
  --card: hsl(222 47% 6%);
  --surface-1: hsl(222 44% 7%);
  --surface-2: hsl(222 40% 10%);
  --surface-3: hsl(217 33% 14%);
  --border: hsl(217 33% 15%);
  --hairline: hsl(220 30% 18%);
  --fg: hsl(210 40% 98%);
  --fg-2: hsl(210 40% 90%);
  --muted: hsl(215 20% 55%);
  --muted-2: hsl(215 20% 40%);
  --orange: #f97316;
  --orange-glow: hsl(24 94% 60%);
  --red: #ef4444;
  --violet: #9061f5;
  --cyan: #0ea5c8;
  --green: #22c55e;
  --amber: #f59e0b;
  --p: #ea6a0a;      /* proteína */
  --c: #0ea5c8;      /* carbohidratos */
  --f: #9061f5;      /* grasas */
  --grad: linear-gradient(135deg, var(--orange) 0%, var(--red) 100%);
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --font-heading: "Bricolage Grotesque", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; border-color: var(--border); }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; line-height: 1.5; overscroll-behavior-y: none;
}
a, button, input, select, textarea, [role="button"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-heading); letter-spacing: -0.02em; font-weight: 600; margin: 0; line-height: 1.15; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
small, .muted { color: var(--muted); }
.hidden { display: none !important; }
.num { font-family: var(--font-heading); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.02em; }

/* ── Shell ── */
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
.bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 40% at 50% -10%, hsl(24 94% 53% / .14), transparent 70%); }
main { position: relative; z-index: 1; padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 8px 24px hsl(24 94% 53% / .35); }
.brand-mark svg { width: 20px; height: 20px; fill: #fff; }
.brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.03em; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: .65rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; padding-bottom: var(--safe-b);
  background: hsl(222 47% 4% / .85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); }
nav.tabs .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--nav-h); }
nav.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .68rem; font-weight: 500; transition: color .2s; }
nav.tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs button.active { color: var(--orange); }
nav.tabs button.active svg { filter: drop-shadow(0 0 8px hsl(24 94% 53% / .5)); }

/* ── Cards & layout ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; }
.card.tight { padding: 12px 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title h3 { font-size: .95rem; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.section-label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .74rem; font-weight: 500;
  border: 1px solid var(--border); background: hsl(217 33% 12% / .5); color: var(--muted); white-space: nowrap; }
.chip.on, .chip-primary { background: linear-gradient(135deg, hsl(24 94% 53% / .15), hsl(0 84% 60% / .15)); border-color: hsl(24 94% 53% / .35); color: var(--orange); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.pill-tag { font-size: .65rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--fg-2); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; transition: transform .2s, box-shadow .2s, background .2s; border: 1px solid transparent; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { box-shadow: 0 10px 30px hsl(24 94% 53% / .35); transform: translateY(-1px); }
.btn-secondary { border-color: var(--border); background: transparent; color: var(--fg); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--fg); background: var(--surface-2); }
.btn-danger { color: var(--red); border-color: hsl(0 84% 60% / .3); }
.btn-sm { padding: 8px 14px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--fg-2); }
.btn-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon.primary { background: var(--grad); border: 0; color: #fff; }
.fab { position: fixed; right: max(16px, calc((100vw - 560px) / 2 + 16px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 30;
  width: 56px; height: 56px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 32px hsl(24 94% 53% / .45); }
.fab svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }

/* ── Forms ── */
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--fg); border-radius: 12px;
  padding: 12px 14px; font: inherit; font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: hsl(24 94% 53% / .6); box-shadow: 0 0 0 3px hsl(24 94% 53% / .15); }
input[type="number"] { font-family: var(--font-heading); font-weight: 600; }
input[type="range"] { padding: 0; height: 32px; accent-color: var(--orange); background: transparent; border: 0; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row input { flex: 1; }
.unit { font-size: .8rem; color: var(--muted); min-width: 32px; }
.seg { display: grid; gap: 6px; grid-auto-flow: column; background: var(--surface-2); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.seg button { padding: 8px 6px; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--grad); color: #fff; }
.option-list { display: grid; gap: 8px; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-1); text-align: left; transition: border-color .2s; }
.option.on { border-color: hsl(24 94% 53% / .6); background: hsl(24 94% 53% / .08); }
.option b { font-weight: 600; display: block; font-size: .92rem; }
.option small { font-size: .74rem; }
.option .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted-2); flex: none; }
.option.on .check { border-color: var(--orange); background: var(--orange); box-shadow: inset 0 0 0 3px var(--bg); }
.toggle { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle.on { background: var(--orange); }
.toggle.on::after { transform: translateX(18px); }

/* ── Progress ring & bars ── */
.ring-wrap { display: grid; place-items: center; position: relative; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-center { position: absolute; text-align: center; }
.ring-center .num { font-size: 2rem; line-height: 1; }
.ring-center small { display: block; font-size: .7rem; margin-top: 2px; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--orange); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar > i.over { background: var(--red); }
.macro { display: flex; flex-direction: column; gap: 5px; }
.macro .row { justify-content: space-between; font-size: .78rem; }
.macro .row b { font-family: var(--font-heading); font-weight: 700; }
.macro.p .bar > i { background: var(--p); } .macro.c .bar > i { background: var(--c); } .macro.f .bar > i { background: var(--f); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.p { background: var(--p); } .dot.c { background: var(--c); } .dot.f { background: var(--f); }

/* ── Diario ── */
.day-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.day-nav h2 { font-size: 1.05rem; text-transform: capitalize; }
.hero-kcal { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.hero-side { text-align: center; }
.hero-side .num { font-size: 1.3rem; display: block; }
.hero-side small { font-size: .68rem; }
.meal { margin-bottom: 10px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.meal-head h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.meal-head .kcal { font-size: .8rem; color: var(--muted); font-family: var(--font-heading); font-weight: 600; }
.entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.entry:first-of-type { border-top: 0; }
.entry .name { font-size: .9rem; font-weight: 500; }
.entry .sub { font-size: .72rem; color: var(--muted); }
.entry .kcal { font-family: var(--font-heading); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.entry .macro-mini { font-size: .68rem; color: var(--muted); }
.entry .macro-mini b { color: var(--fg-2); font-weight: 500; }
.add-line { display: flex; align-items: center; gap: 8px; color: var(--orange); font-size: .85rem; font-weight: 600; padding: 8px 0 2px; }
.add-line svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.empty { color: var(--muted-2); font-size: .82rem; padding: 6px 0; }
.water-cups { display: flex; flex-wrap: wrap; gap: 6px; }
.cup { width: 34px; height: 40px; border-radius: 8px 8px 10px 10px; border: 1.5px solid var(--border); background: var(--surface-2); position: relative; overflow: hidden; }
.cup.full { border-color: hsl(190 95% 55% / .6); }
.cup.full::after { content: ""; position: absolute; inset: 20% 0 0; background: linear-gradient(180deg, hsl(190 95% 55% / .7), hsl(200 95% 45% / .9)); }
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); font-size: .68rem; font-weight: 500; color: var(--fg-2); }
.quick svg { width: 22px; height: 22px; stroke: var(--orange); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.streak { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--amber); }

/* ── Search / sheet ── */
.sheet-backdrop { position: fixed; inset: 0; background: hsl(222 47% 2% / .7); backdrop-filter: blur(4px); z-index: 50; opacity: 0; transition: opacity .2s; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 560px; margin: 0 auto;
  background: var(--bg-2); border: 1px solid var(--border); border-bottom: 0; border-radius: 24px 24px 0 0;
  max-height: 92dvh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  padding-bottom: var(--safe-b); }
.sheet.show { transform: translateY(0); }
.sheet.full { height: 92dvh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--hairline); }
.sheet-head h2 { font-size: 1.05rem; }
.sheet-body { overflow-y: auto; padding: 14px 16px 24px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 16px; border-top: 1px solid var(--hairline); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.grabber { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 8px auto 0; }
.search-box { position: relative; margin-bottom: 10px; }
.search-box input { padding-left: 42px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.food-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--hairline); text-align: left; width: 100%; }
.food-item .name { font-size: .92rem; font-weight: 500; }
.food-item .sub { font-size: .72rem; color: var(--muted); }
.food-item .kcal { font-family: var(--font-heading); font-weight: 700; color: var(--fg-2); }
.food-item .star { width: 18px; height: 18px; stroke: var(--muted-2); fill: none; stroke-width: 2; flex: none; }
.food-item .star.on { stroke: var(--amber); fill: var(--amber); }
.big-num { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.macro-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.macro-pills span { font-size: .74rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.portion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.portion-grid button { padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1); font-size: .8rem; }
.portion-grid button.on { border-color: var(--orange); color: var(--orange); background: hsl(24 94% 53% / .08); }

/* ── Plan / recetas ── */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.week-strip button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; font-size: .68rem; color: var(--muted); border: 1px solid transparent; }
.week-strip button b { font-family: var(--font-heading); font-size: 1rem; color: var(--fg); }
.week-strip button.on { background: hsl(24 94% 53% / .1); border-color: hsl(24 94% 53% / .4); color: var(--orange); }
.week-strip button.on b { color: var(--orange); }
.recipe-card { display: flex; gap: 12px; align-items: stretch; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-1); margin-bottom: 8px; text-align: left; width: 100%; }
.recipe-thumb { width: 64px; flex: none; border-radius: 12px; background: linear-gradient(135deg, hsl(24 94% 53% / .35), hsl(0 84% 60% / .35)); display: grid; place-items: center; font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: #fff; }
.recipe-card .name { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.recipe-card .meta { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.recipe-card .kcal { font-family: var(--font-heading); font-weight: 700; margin-top: 4px; font-size: .85rem; }
.plan-slot { margin-bottom: 12px; }
.plan-slot h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.shop-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--orange); padding: 0; }
.shop-item.done { text-decoration: line-through; color: var(--muted-2); }
.shop-item .g { margin-left: auto; font-family: var(--font-heading); font-weight: 600; color: var(--fg-2); }

/* ── Progreso ── */
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { padding: 12px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); }
.tile small { font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.tile .num { font-size: 1.3rem; display: block; margin-top: 2px; }
.tile .delta { font-size: .72rem; font-weight: 600; }
.delta.down { color: var(--green); } .delta.up { color: var(--red); } .delta.flat { color: var(--muted); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font-body); font-size: 10px; fill: var(--muted); }
.chart .grid { stroke: var(--hairline); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#gradArea); }
.chart .pt { fill: var(--orange); stroke: var(--bg); stroke-width: 2; }
.chart .bar-k { fill: var(--orange); }
.chart .bar-k.over { fill: var(--red); }
.chart .target { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border); padding: 6px 10px; border-radius: 10px; font-size: .72rem; white-space: nowrap; transform: translate(-50%, -120%); display: none; }
.chart-wrap { position: relative; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.photo-grid .ph { position: relative; }
.photo-grid .ph small { position: absolute; bottom: 4px; left: 6px; font-size: .62rem; background: hsl(222 47% 3% / .7); padding: 2px 6px; border-radius: 6px; color: var(--fg-2); }

/* ── Ayuno ── */
.fast-ring { display: grid; place-items: center; position: relative; margin: 8px auto; }
.fast-ring .center { position: absolute; text-align: center; }
.fast-ring .center .num { font-size: 1.9rem; }
.fast-state { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--orange); }

/* ── Coach chat ── */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.45; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.ai.thinking { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; }

/* ── Onboarding ── */
.onb { min-height: 100dvh; display: flex; flex-direction: column; padding: 24px 20px 32px; position: relative; z-index: 1; }
.onb-steps { display: flex; gap: 4px; margin: 12px 0 24px; }
.onb-steps i { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); }
.onb-steps i.on { background: var(--grad); }
.onb h1 { font-size: 1.7rem; margin-bottom: 6px; }
.onb .lead { color: var(--muted); margin-bottom: 20px; font-size: .95rem; }
.onb .body { flex: 1; }
.onb .foot { display: flex; gap: 10px; margin-top: 20px; }
.onb .foot .btn { flex: 1; }
.result-hero { text-align: center; padding: 20px 0; }
.result-hero .big-num { font-size: 3.4rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Toast ── */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 20px); transform: translate(-50%, 20px); z-index: 60;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--fg); padding: 10px 16px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  opacity: 0; transition: all .25s; box-shadow: 0 10px 30px hsl(0 0% 0% / .4); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Scanner ── */
.scanner video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 3/4; object-fit: cover; }
.scan-frame { position: absolute; inset: 25% 12%; border: 2px solid hsl(24 94% 53% / .8); border-radius: 12px; box-shadow: 0 0 0 999px hsl(222 47% 2% / .45); }

/* ── Table view (accesibilidad gráfico) ── */
details.tbl summary { font-size: .75rem; color: var(--muted); cursor: pointer; margin-top: 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: .78rem; margin-top: 6px; }
table.data td, table.data th { padding: 5px 4px; border-bottom: 1px solid var(--hairline); text-align: left; }
table.data td:last-child, table.data th:last-child { text-align: right; font-family: var(--font-heading); }

@media (min-width: 600px) {
  #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .fab { right: calc((100vw - 560px) / 2 + 16px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── Cuenta / sync ── */
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.sync-dot.ok { background: var(--green); } .sync-dot.syncing { background: var(--amber); animation: pulse 1s infinite; }
.sync-dot.error { background: var(--red); } .sync-dot.offline { background: var(--muted); }
@keyframes pulse { 50% { opacity: .3; } }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-top: 1px solid var(--hairline); font-size: .85rem; }
.user-row .sub { font-size: .7rem; color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: .08em; color: var(--orange); }
