/* 2026-09-19 · Phone-first density, also on PC. Loaded last on purpose: it wins over the older layers. */

/* The section row stays at the top, with dates grouped at the right. */
html { overflow-y:scroll; }
body.fituba-app .app-chrome { position:static; }
body.fituba-app :is(.app-header #settingsButton, #dayFriendsButton, .bottom-nav) { display:none; }
body.fituba-app #appShell { padding-bottom:0; }
body.fituba-app .app-shell .day-heading { position:sticky; top:0; z-index:30; display:flex; flex-wrap:nowrap; align-items:center; justify-content:space-between; gap:8px; min-height:52px; margin:0 -12px 10px; padding:6px 12px; background:#f6f8f6; }
body.fituba-app.fitness-date-loading .day-heading, body.fituba-app .fitness-date-loading .day-heading { opacity:1; }
body.fituba-app .fitness-date-loading .day-picker-wrap { opacity:.65; }
.section-nav { display:flex; flex:0 1 auto; min-width:0; gap:2px; padding:3px; border-radius:14px; background:#e8efe9; overflow-x:auto; scrollbar-width:none; }
.section-nav::-webkit-scrollbar { display:none; }
.section-nav-item { display:flex; flex:none; align-items:center; justify-content:center; gap:7px; height:44px; min-width:44px; padding:0 12px; border:0; border-radius:11px; background:none; color:#566e60; font:inherit; font-size:14px; font-weight:650; cursor:pointer; }
.section-nav-item svg { width:21px; height:21px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.section-nav-item:hover { color:#1d6a45; }
.section-nav-item[aria-current=page] { background:#fff; color:#1d6a45; box-shadow:0 1px 4px #1b3f2a1f; }
.section-nav-item[aria-current=page] svg { stroke-width:2.2; }
.section-nav-item:focus-visible { outline:3px solid #268a64; outline-offset:1px; }
body.fituba-app .app-shell .day-heading .day-picker-wrap { display:flex; flex:none; align-items:center; gap:6px; margin-left:auto; min-width:0; }
body.fituba-app .day-heading:not([data-route=hoy]) .day-tools :is(.today-more-content,.today-day-footer) { display:none; }
body.fituba-app .day-heading .day-tools { position:static; }
body.fituba-app .day-heading .day-tools > summary { width:44px; min-width:0; height:44px; border-radius:12px; }
body.fituba-app .day-heading .day-tools.is-past-date > summary { flex-direction:column; gap:1px; padding:0; }
body.fituba-app #calendarSelectedLabel { font-size:9px; line-height:1; }
body.fituba-app .day-heading .day-tools-panel { top:calc(100% + 4px); right:0; left:auto; }
body.fituba-app .day-heading .day-picker { padding:3px; border-radius:14px; }
body.fituba-app .day-heading .day-picker-button { min-height:44px; height:44px; min-width:0; padding:0 12px; font-size:14px; border-radius:11px; }
body.fituba-app .route-toolbar { margin:0 0 12px; }

/* Phones: short labels under the icons; Admin (owner only) stays a small icon. */
@media (max-width:767px) {
  .section-nav-item { flex-direction:column; justify-content:center; gap:2px; min-width:44px; padding:0 5px; font-size:11px; font-weight:650; line-height:1; letter-spacing:-.1px; }
  .section-nav-item svg { width:18px; height:18px; }
  .section-nav-item[data-target=admin] { min-width:22px; width:22px; padding:0; }
  .section-nav-item[data-target=admin] span { display:none; }
  .section-nav-item[data-target=admin] svg { width:14px; height:14px; opacity:.7; }
  body.fituba-app .app-shell .day-heading { gap:6px; }
  body.fituba-app .day-heading .day-tools > summary { width:36px; }
  body.fituba-app .day-heading .day-picker-wrap { gap:4px; }
  body.fituba-app .day-heading .day-picker-button { padding:0 9px; font-size:13px; }
}
/* «Comunidad» is the longest label: narrow phones tighten the row so every destination (and Admin) fits. */
@media (max-width:420px) {
  .section-nav { gap:0; padding:2px; }
  .section-nav-item { min-width:42px; padding:0 2px; font-size:10.5px; letter-spacing:-.2px; }
  .section-nav-item[data-target=admin] { width:20px; min-width:20px; }
  body.fituba-app .app-shell .day-heading { gap:4px; }
  body.fituba-app .day-heading .day-tools > summary { width:34px; }
  body.fituba-app .day-heading .day-picker-button { padding:0 5px; }
  /* Each day button only as wide as its word («Today» no longer takes «Yesterday»'s width). */
  body.fituba-app .day-heading .day-picker { grid-template-columns:repeat(2,auto); }
  /* English labels are longer: the 44 px minimum width would push «Profile» out of the row. */
  html[lang=en] .section-nav-item { min-width:32px; }
}
@media (max-width:350px) {
  .section-nav-item { width:32px; min-width:32px; padding:0; }
  .section-nav-item span { display:none; }
}

/* 3. Manual reads as a button; Registrar is flatter and ~10% smaller, with tighter spacing around both. */
body.fituba-app #entryForm .composer-actions { margin-top:8px; align-items:center; }
body.fituba-app #entryForm .manual-nutrition-details > summary { display:inline-flex; align-items:center; gap:7px; min-height:40px; padding:0 14px; border:1px solid #cddfd2; border-radius:12px; background:#f2f7f2; color:#285c41; font-size:15px; font-weight:650; }
body.fituba-app #entryForm .manual-nutrition-details > summary small { margin:0; color:#5d7466; font-size:12px; font-weight:500; }
body.fituba-app #entryForm .manual-nutrition-details > summary svg { width:20px; height:20px; }
body.fituba-app #entryForm .manual-nutrition-details > summary:hover { background:#e9f2ea; }
body.fituba-app #entryForm .manual-nutrition-details[open] > summary { background:#e3efe5; border-color:#b7d2bf; }
body.fituba-app #entryForm .manual-nutrition-details > summary:focus-visible { outline:3px solid #268a64; outline-offset:2px; }
body.fituba-app #entryForm .composer-footer { margin:0; gap:8px; }
body.fituba-app #entryForm #entrySubmit { min-height:40px; height:40px; padding:0 18px; border-radius:12px; font-size:14.5px; box-shadow:0 1px 2px #16432b26; }
body.fituba-app #entryForm #entrySubmit:not(:disabled):hover { box-shadow:0 2px 6px #16432b33; }
body.fituba-app #entryForm #entrySubmit:disabled { box-shadow:none; }

/* 4. Hoy card: smaller points chip and a goals button that belongs to the dark card. */
body.fituba-app #page-hoy #calorieCard.daily-dashboard .today-overview-heading { margin-bottom:14px; gap:8px; }
body.fituba-app #page-hoy #calorieCard.daily-dashboard .today-overview-heading > div { gap:10px; }
body.fituba-app #page-hoy #calorieCard .day-state-inline { display:none; }
.daily-goals-edit { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:0 11px; border:1px solid #cfe6c438; border-radius:10px; background:#ffffff12; color:#d9eed4; font:inherit; font-size:12.5px; font-weight:600; white-space:nowrap; cursor:pointer; }
.daily-goals-edit svg { width:15px; height:15px; flex:none; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.daily-goals-edit:hover { background:#ffffff1f; color:#fff; }
.daily-goals-edit:focus-visible { outline:3px solid #b9e58f; outline-offset:2px; }
.daily-goals-edit .goals-label-short { display:none; }
body.fituba-app .daily-points { min-height:32px; padding:0 10px; gap:4px; font-size:11.5px; border-radius:10px; }
body.fituba-app .daily-points strong { font-size:14px; }
body.fituba-app .daily-points:focus-visible { outline:3px solid #b9e58f; outline-offset:2px; }
@media (max-width:360px) {
  /* 320 px: the long label ran over the points chip. */
  .daily-goals-edit { padding:0 8px; font-size:11.5px; }
  .daily-goals-edit .goals-label-long { display:none; }
  .daily-goals-edit .goals-label-short { display:inline; }
  body.fituba-app .daily-points { padding:0 8px; }
}

/* 5. Current rank card: the next three ranks with progress, then all ranks on demand. */
#accountHub .account-game-hero > .account-rank-more { grid-column:1 / -1; min-width:0; }
#accountHub .account-rank-more > summary { min-height:38px; display:flex; align-items:center; justify-content:center; gap:6px; color:#d7ecb4; font-size:13px; font-weight:650; cursor:pointer; list-style:none; }
#accountHub .account-rank-more > summary::-webkit-details-marker { display:none; }
#accountHub .account-rank-more > summary::after { content:'+'; font-size:17px; font-weight:400; }
#accountHub .account-rank-more[open] > summary::after { content:'−'; }
#accountHub .account-rank-more > summary:focus-visible { outline:2px solid #b9e58f; outline-offset:2px; border-radius:8px; }
/* Phones and tablets: the public-profile card (offer or link) lives only in Progreso; from 1000px it stays in the left column. */
.rank-upcoming { list-style:none; margin:0; padding:12px 0 0; border-top:1px solid #ffffff1f; display:grid; gap:9px; }
.rank-upcoming li { display:grid; grid-template-columns:30px minmax(0,1fr) auto; gap:10px; align-items:center; }
.rank-upcoming .rank-badge { --rank-size:30px; box-shadow:none; }
.rank-up-copy { display:grid; gap:5px; min-width:0; }
.rank-up-copy > span { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.rank-up-copy strong { font-size:13.5px; color:#f3faf5; }
.rank-up-copy small { font-size:11.5px; color:#c2dacb; white-space:nowrap; }
.rank-upcoming progress { width:100%; height:5px; display:block; appearance:none; border:0; border-radius:6px; overflow:hidden; background:#ffffff22; }
.rank-upcoming progress::-webkit-progress-bar { background:#ffffff22; }
.rank-upcoming progress::-webkit-progress-value { background:#b8d991; border-radius:6px; }
.rank-upcoming progress::-moz-progress-bar { background:#b8d991; }
.rank-upcoming li > b { font-size:11.5px; font-weight:650; color:#d7ecb4; white-space:nowrap; }
.rank-upcoming-note { margin:8px 0 0; font-size:12px; line-height:1.45; color:#cfe3d6; }
#accountHub .account-game-hero .fitness-levels { margin:2px 0 0; border:0; }
#accountHub .account-game-hero .fitness-levels > summary { min-height:38px; justify-content:center; gap:6px; color:#d7ecb4; font-size:13px; font-weight:650; }
#accountHub .account-game-hero .fitness-levels > summary::after { font-size:17px; }
#accountHub .account-game-hero .fitness-levels > summary:focus-visible { outline-color:#b9e58f; }
#accountHub .account-game-hero .fitness-level-road { margin:4px 0 8px; padding:6px; border-radius:12px; background:#fff; }
#accountHub .account-game-hero .rank-rule-note { margin:0; font-size:11.5px; line-height:1.45; color:#cfe3d6; }

/* 6. Mi día · 2026-10-07. Manual at 16 px (iOS zooms below it); no empty boxes; one status line per text and a small
   result pop-up (bottom sheet on phones, floating card on a wide screen) to review before the day takes it in. */
body.fituba-app #entryForm .manual-food-panel input { font-size:16px; }
body.fituba-app :is(.trend-card, .entries-section, .daily-plots, .daily-plot)[hidden] { display:none !important; }
.daily-plots[data-count="1"] { grid-template-columns:minmax(0,1fr); }
#page-hoy #calorieCard { scroll-margin-top:64px; }
.entry-line-host { margin-top:4px; }
.entry-line { display:flex; align-items:center; gap:6px; width:100%; min-height:44px; padding:0 4px; border:0; border-radius:10px; background:none; color:#3f5a4a; font:inherit; font-size:14px; line-height:1.4; text-align:left; cursor:pointer; }
.entry-line[hidden] { display:none; }
.entry-line-state { display:inline-flex; align-items:center; gap:6px; flex:none; font-weight:650; color:#557064; }
.entry-line[data-state=done] .entry-line-state { color:#1f6e47; }
.entry-line-sep { flex:none; color:#8a9a90; }
.entry-line-text { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.entry-line[aria-expanded=true] { align-items:flex-start; padding-block:11px; }
.entry-line[aria-expanded=true] .entry-line-text { white-space:normal; overflow-wrap:anywhere; }
.entry-line:hover { background:#f3f7f3; }
.entry-line:focus-visible { outline:3px solid #268a64; outline-offset:2px; }
.result-sheet { position:fixed; z-index:70; left:0; right:0; bottom:0; display:grid; gap:7px; max-height:45vh; overflow:auto; padding:6px 16px calc(14px + env(safe-area-inset-bottom)); background:#fff; color:#183e2d; border-radius:20px 20px 0 0; box-shadow:0 -10px 32px #10291c2e; outline:none; }
.result-sheet[hidden] { display:none; }
.result-sheet-handle { justify-self:center; width:38px; height:4px; border-radius:2px; background:#cfdcd2; }
.result-sheet-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
.result-sheet h2 { margin:0; font-size:17px; line-height:1.3; letter-spacing:-.2px; color:#173b2c; }
.result-sheet-lead { margin:1px 0 0; font-size:13px; line-height:1.4; color:#557064; }
.result-sheet-close { flex:none; width:44px; height:44px; margin:-8px -10px 0 0; border:0; border-radius:12px; background:none; color:#557064; font:inherit; font-size:24px; line-height:1; cursor:pointer; }
.result-sheet-close:hover { background:#f2f7f2; }
.result-sheet-body { display:grid; gap:6px; }
.result-sheet-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.result-kcal { font-size:32px; line-height:1.05; letter-spacing:-1px; font-variant-numeric:tabular-nums; }
.result-kcal small { margin-left:4px; font-size:13px; font-weight:600; letter-spacing:0; color:#557064; }
.result-protein { display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border-radius:999px; background:#e2f5ec; color:#11603f; font-size:13px; white-space:nowrap; }
.result-protein b { font-size:17px; }
.result-sheet .adaptive-key { width:8px; height:8px; }
.result-macro-bar { display:block; width:100%; height:6px; border-radius:3px; overflow:hidden; }
.result-macros { display:flex; flex-wrap:wrap; gap:2px 12px; margin:0; font-size:12px; line-height:1.4; color:#3f5a4a; }
.result-macros>span { display:inline-flex; align-items:center; gap:4px; }
.result-foods { display:grid; gap:2px; margin:0; padding:5px 0 0; border-top:1px solid #edf2ec; list-style:none; font-size:13px; line-height:1.4; color:#3f5a4a; }
.result-foods li { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; gap:8px; align-items:baseline; font-variant-numeric:tabular-nums; }
.result-foods .result-food-more { display:block; color:#557064; }
.result-food-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#183e2d; font-weight:600; }
.result-foods b { color:#11603f; }
.result-summary { margin:0; font-size:14px; line-height:1.4; color:#3f5a4a; }
.result-extras { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.result-chip, .result-points { padding:3px 10px; border-radius:999px; font-size:12.5px; font-weight:650; line-height:1.5; }
.result-chip { background:#e8eff8; color:#2c4f7c; }
.result-chip.is-weights { background:#e7f1ea; color:#285c41; }
.result-points { background:#fdf3d8; color:#6e4a00; }
.result-sheet-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(0,1fr)); gap:8px; margin-top:2px; }
.result-sheet-actions .button { min-height:44px; margin:0; padding:0 14px; border-radius:12px; font-size:15px; font-weight:650; }
.result-sheet-actions .button[hidden] { display:none; }
.result-sheet-actions .button-primary { background:#28784f; border-color:#28784f; color:#fff; }
.result-sheet-actions .button-secondary { background:#f2f7f2; border:1px solid #cddfd2; color:#285c41; }
.result-sheet :is(button):focus-visible { outline:3px solid #268a64; outline-offset:2px; }
@media (prefers-reduced-motion:no-preference) {
  .result-sheet:not([hidden]) { animation:result-sheet-up .28s cubic-bezier(.2,.8,.2,1); }
  @keyframes result-sheet-up { from { transform:translateY(100%); } }
}
@media (min-width:768px) {
  .result-sheet { left:auto; right:24px; bottom:24px; width:380px; max-height:min(70vh, 560px); padding:16px 18px; border-radius:20px; box-shadow:0 18px 44px #10291c33; }
  .result-sheet-handle { display:none; }
}
@media (min-width:768px) and (prefers-reduced-motion:no-preference) {
  .result-sheet:not([hidden]) { animation:result-card-in .22s ease-out; }
  @keyframes result-card-in { from { opacity:0; transform:translateY(10px) scale(.98); } }
}
/* Four periods (7 · 15 · 30 días · 3 meses): one row; on phones a full-width row under the title. */
body.fituba-app .progress-history .trend-header .segmented { grid-template-columns:repeat(4,auto); }
@media (max-width:560px) {
  body.fituba-app .progress-history .trend-header .segmented { width:100%; grid-template-columns:repeat(4,minmax(0,1fr)); }
}
/* 375 px review (2026-10-07): iOS zooms into fields under 16 px (history date and type were 13 px); the AI quota
   toggle was a 24 px tall target: 44 px now, text in the same place. */
body.fituba-app .history-toolbar :is(input, select) { font-size:16px; }
body.fituba-app .composer-card .ai-quota-details { top:6px; }
body.fituba-app .composer-card .ai-quota { min-height:44px; }
body.fituba-app .composer-card .ai-quota-details p { top:44px; }

/* 2026-10-13 · Mi día compacto (Carlos): one field like the landing — dictation and send inside, centred together;
   «Manual» a light button and the AI quota on the same row; ideas in the placeholder, smaller and lighter. */
body.fituba-app #entryForm { padding-top:14px; }
body.fituba-app #entryForm #entryPrompt { position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
body.fituba-app #entryForm .composer-input { position:relative; display:block; min-height:0; border-radius:16px; }
body.fituba-app #entryForm #entryText { display:block; width:100%; height:60px; min-height:60px; max-height:190px; padding:10px 162px 10px 14px; resize:none; font-size:16px; line-height:1.4; }
body.fituba-app #entryForm #entryText::placeholder { font-size:.85em; line-height:1.45; opacity:.9; }
body.fituba-app #entryForm :is(#entryMic, #entrySubmit) { position:absolute; top:auto; bottom:9px; display:grid; place-items:center; width:42px; min-width:42px; height:42px; min-height:42px; margin:0; padding:0; border-radius:12px; transform:none; }
body.fituba-app #entryForm #entryMic { right:111px; }
body.fituba-app #entryForm #entryMic span { display:none; }
body.fituba-app #entryForm :is(#entryMic, #entrySubmit) svg { width:20px; height:20px; }
body.fituba-app #entryForm #entrySubmit { right:9px; width:96px; min-width:96px; min-height:44px; font-size:13px; border:0; background:#b6ef65; color:#10251f; cursor:pointer; }
body.fituba-app #entryForm:has(#manualNutritionDetails[open]) #entryText { padding-right:64px; }
body.fituba-app #entryForm:has(#manualNutritionDetails[open]) #entryMic { right:9px; }
body.fituba-app #entryForm #manualNutritionDetails #entrySubmit { position:static; width:100%; margin-top:10px; }
body.fituba-app #entryForm #entrySubmit svg { fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
body.fituba-app #entryForm #entrySubmit:disabled { background:#e7eee5; color:#8ca094; cursor:default; }
body.fituba-app #entryForm #entrySubmit:focus-visible { outline:3px solid #268a64; outline-offset:2px; }
body.fituba-app #entryForm .composer-actions { margin-top:8px; }
body.fituba-app #entryForm .composer-actions:not(:has(.manual-nutrition-details[open])) { grid-template-columns:max-content minmax(0,1fr); }
body.fituba-app #entryForm .manual-nutrition-details > summary { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; min-height:44px; padding:0 14px; border:1px solid #d3e1d6; border-radius:999px; background:#f3f8f2; color:#2a5640; font-size:14px; font-weight:700; }
body.fituba-app #entryForm .manual-nutrition-details > summary::before { content:none; }
body.fituba-app #entryForm .manual-nutrition-details > summary svg { width:17px; height:17px; }
body.fituba-app #entryForm .manual-nutrition-details > summary small { font-size:12px; font-weight:500; color:#647a6d; }
body.fituba-app #entryForm .manual-nutrition-details[open] > summary { background:#e8f2e6; border-color:#bcd3c1; }
body.fituba-app #entryForm .composer-footer { margin:0; }
body.fituba-app #entryForm .ai-quota-details { position:relative; top:auto; right:auto; }
body.fituba-app #entryForm .ai-quota { max-width:none; font-size:12px; white-space:normal; text-align:right; }
/* 2026-10-13 · Hoy más compacto: the streak row and «Detalles de calorías» take less height. */
#page-hoy #calorieCard .daily-streak { gap:10px; margin-top:12px; padding-top:10px; }
#page-hoy #calorieCard .daily-streak-icon { width:32px; height:32px; font-size:18px; border-radius:10px; }
#page-hoy #calorieCard .daily-streak > strong { font-size:16px; letter-spacing:-.2px; }
#page-hoy #calorieCard .daily-week > span { width:16px; height:20px; font-size:11px; border-radius:6px; }
#page-hoy #calorieCard.daily-dashboard .compact-calorie-details { margin:4px 0 0; padding:0; border-top:0; }
#page-hoy #calorieCard.daily-dashboard .compact-calorie-details summary { min-height:32px; font-size:12px; }
