:root{
  --bg: #0b0d12;
  --panel: rgba(255,255,255,.06);
  --panel-2: rgba(255,255,255,.085);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.64);
  --hair: rgba(255,255,255,.12);
  --accent: #ecc465;
  --danger: #ff3d71;
  --shadow: 0 30px 80px rgba(0,0,0,.45);
  --font-body: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: "Fraunces", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --keyboard-inset: 0px;
}

body[data-theme="light"]{
  --bg: #fbfbff;
  --panel: rgba(0,0,0,.05);
  --panel-2: rgba(0,0,0,.075);
  --text: rgba(8,10,14,.92);
  --muted: rgba(8,10,14,.62);
  --hair: rgba(0,0,0,.14);
  --accent: #ecc465;
  --shadow: 0 30px 90px rgba(25,35,55,.16);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
[hidden]{ display:none !important; }
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 10% 10%, #3d4c83, transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(81,131,255,.12), transparent 60%),
    radial-gradient(1100px 700px at 50% 110%, rgba(255,61,113,.08), transparent 60%),
    var(--bg);
}
body.has-app-shell{
  overflow:hidden;
}
body.has-chat-page .app-main__content{
  overflow:hidden;
}
body.sidebar-mobile-open{
  overflow:hidden;
}
body.is-standalone{
  overscroll-behavior:none;
}

a{ color:inherit; text-decoration:none; }

.app-shell{
  display:grid;
  grid-template-columns:280px minmax(0, 1fr);
  min-height:100dvh;
  height:100dvh;
}
.app-sidebar{
  position:relative;
  z-index:300;
  display:flex;
  flex-direction:column;
  gap:18px;
  min-height:100dvh;
  height:100dvh;
  padding:18px 14px;
  padding-top:calc(18px + env(safe-area-inset-top));
  padding-bottom:calc(18px + env(safe-area-inset-bottom));
  border-right:1px solid var(--hair);
  background:rgba(8,10,14,.74);
  backdrop-filter: blur(20px);
  font-size: 16px;
}
body[data-theme="light"] .app-sidebar{
  background:rgba(255,255,255,.82);
}
.app-sidebar__top,
.app-sidebar__footer{
  display:flex;
  align-items:center;
  gap:10px;
}
.app-sidebar__top{
  justify-content:space-between;
}
.app-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.app-brand__mark,
.app-nav__icon,
.app-user__avatar{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  flex:0 0 auto;
  font-weight:800;
}
.app-brand__mark{
  background:linear-gradient(135deg, #0b2a9c, rgba(81,131,255,.78));
  color:#071018;
  box-shadow:0 14px 30px rgba(0,0,0,.22);
  overflow:hidden;
}
.brand-logo{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.brand-logo--mobile{
  width:28px;
  height:28px;
  border-radius:10px;
  flex:0 0 auto;
}
.app-brand__text,
.app-user__meta{
  min-width:0;
  display:flex;
  flex-direction:column;
}
.app-brand__title{
  font-family:var(--font-display);
  font-size:18px;
  font-weight:800;
}
.app-brand__sub,
.app-user__role{
  color:var(--muted);
  font-size:12px;
}
.sidebar-toggle{
  border:1px solid var(--hair);
  background:var(--panel);
  color:var(--text);
  width:40px;
  height:40px;
  border-radius:14px;
  display:grid;
  place-items:center;
  gap:4px;
  cursor:pointer;
}
.sidebar-toggle:hover{ background:var(--panel-2); }
.sidebar-toggle__bar{
  display:block;
  width:16px;
  height:2px;
  background:currentColor;
  border-radius:999px;
}
.app-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1 1 auto;
}
.app-nav__item,
.app-logout{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  border:none;
  padding:8px;
  border-radius:18px;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  text-align:left;
}
.app-nav__item:hover,
.app-logout:hover{
  background:var(--panel);
}
.app-nav__item.is-active{
  background:#0b2a9c;
  border:1px solid #020f41;
}
html body[data-theme="light"] .app-nav__item.is-active{
  background: var(--accent) !important;
  border-color: rgba(0,0,0,.10) !important;
  color: #1a1200;
}
html body[data-theme="light"] .app-nav__item.is-active .app-nav__icon{
  color: #1a1200;
  border-color: rgba(0,0,0,.12);
  background: rgba(0,0,0,.06);
}
.app-nav__icon,
.app-user__avatar{
  border:1px solid var(--hair);
  background:rgba(255,255,255,.04);
}
.app-nav__label{
  font-weight:700;
  white-space:nowrap;
}
.app-sidebar__footer{
  margin-top:auto;
  flex-direction:column;
  align-items:stretch;
}
.app-user{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  border:1px solid var(--hair);
  border-radius:18px;
  background:rgba(255,255,255,.04);
}
.app-user__name{
  font-weight:700;
}
.app-logout{
  margin-top:8px;
  border:1px solid var(--hair);
}
.app-install .app-nav__icon,
.app-install--mobile{
  color:var(--accent);
}
.app-main{
  min-width:0;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
}
body.has-chat-page .app-main{
  height:100dvh;
  max-height:100dvh;
  overflow:hidden;
}
.app-main__content{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
}
.app-mobilebar{
  display:none;
}
.app-mobilebar__brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-family:var(--font-display);
  font-weight:800;
}
.app-mobilebar__actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.app-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.42);
  z-index:250;
  backdrop-filter: blur(2px);
}

.app-shell[data-sidebar-state="collapsed"]{
  grid-template-columns:92px minmax(0, 1fr);
}
.app-shell[data-sidebar-state="collapsed"] .app-sidebar{
  padding-inline:10px;
}
.app-shell[data-sidebar-state="collapsed"] .app-brand__text,
.app-shell[data-sidebar-state="collapsed"] .app-nav__label,
.app-shell[data-sidebar-state="collapsed"] .app-user__meta,
.app-shell[data-sidebar-state="collapsed"] .theme-toggle__label{
  display:none;
}
.app-shell[data-sidebar-state="collapsed"] .app-nav__item,
.app-shell[data-sidebar-state="collapsed"] .app-logout{
  justify-content:center;
}
.app-shell[data-sidebar-state="collapsed"] .app-user{
  justify-content:center;
}
.app-shell[data-sidebar-state="collapsed"] .app-sidebar__top{
  flex-direction:column;
}

.shell{
  max-width:1040px;
  margin:0 auto;
  padding:32px 20px 52px;
}

.hero{ display:flex; flex-direction:column; gap:18px; }
.hero-top{ display:flex; align-items:center; justify-content:space-between; gap:16px; }

.brand{ display:flex; align-items:center; gap:14px; }
.brand-mark{
  width:42px; height:42px; border-radius:14px;
  display:grid; place-items:center;
  background:linear-gradient(135deg, #0b2a9c, rgba(0, 0, 0, 0.8));
  color:#091017;
  font-family:var(--font-display);
  font-weight:700;
  box-shadow:0 18px 40px rgba(0,0,0,.25);
  overflow:hidden;
}
.brand-name{ font-family:var(--font-display); font-size:20px; letter-spacing:.2px; }
.brand-sub{ color:var(--muted); font-size:12px; margin-top:2px; }

.theme-toggle{
  border:1px solid var(--hair);
  background:var(--panel);
  color:var(--text);
  border-radius:999px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease;
}
.theme-toggle:hover{ transform:translateY(-1px); background:var(--panel-2); }
.theme-toggle__dot{ width:10px; height:10px; border-radius:999px; background:var(--accent); box-shadow:0 0 0 4px rgba(184,255,74,.14); }
.theme-toggle__label{ font-size:12px; color:var(--muted); }
html body[data-theme="light"] .theme-toggle__dot{
  background: #2e60ff;
  box-shadow: 0 0 0 4px rgba(46,96,255,.16);
}

.hero-card{
  background:linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.05));
  border:1px solid var(--hair);
  border-radius:24px;
  padding:18px;
  box-shadow:var(--shadow);
  backdrop-filter: blur(14px);
}
.hero-meta{ display:flex; flex-wrap:wrap; gap:8px; }
.meta-chip{
  border:1px solid var(--hair);
  background:rgba(255,255,255,.04);
  border-radius:999px;
  padding:8px 10px;
  display:flex;
  gap:10px;
  align-items:center;
}
.meta-k{ font-size:12px; color:var(--muted); }
.meta-v{ font-size:12px; font-weight:600; }

.hero-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}
.stat{
  padding:14px 14px 12px;
  border:1px solid var(--hair);
  border-radius:18px;
  background:rgba(0,0,0,.08);
}
body[data-theme="light"] .stat{ background:rgba(255,255,255,.55); }
.stat-k{ color:var(--muted); font-size:12px; }
.stat-v{ margin-top:8px; font-size:18px; font-weight:700; letter-spacing:.2px; font-family:var(--font-display); }

.summary{ margin-top:16px; }
.summary-title{ font-weight:700; letter-spacing:.2px; }
.summary-grid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}
.dashboard-history{
  margin-top:18px;
}
.dashboard-history__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.history-filters{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr)) auto;
  gap:12px;
  align-items:end;
}
.history-filters__presets{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.history-filters .cta,
.history-filters .field input,
.history-filters .field select{
  min-height:42px;
}
.history-status{
  margin-top:12px;
  color:var(--muted);
  font-size:12px;
}
.history-charts{
  margin-top:14px;
  display:grid;
  grid-template-columns:minmax(0, 1.2fr) minmax(0, 1fr);
  gap:14px;
}
.history-chart-card{
  border:1px solid var(--hair);
  border-radius:22px;
  padding:16px;
  background:rgba(255,255,255,.04);
  display:flex;
  flex-direction:column;
  gap:14px;
}
.history-chart-card--weight{
  grid-column:1 / -1;
  min-height:340px;
}
.history-chart-card--calories{
  min-height:360px;
}
.history-chart-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.history-chart-card__canvas{
  position:relative;
  min-height:220px;
  flex:1 1 auto;
}
.history-chart-card--calories .history-chart-card__canvas{
  min-height:280px;
}
.history-chart-card--weight .history-chart-card__canvas{
  min-height:250px;
}
.history-chart-card__canvas canvas{
  width:100%;
  height:100%;
  display:block;
}
.history-tooltip{
  position:absolute;
  z-index:4;
  min-width:150px;
  max-width:220px;
  padding:10px 12px;
  border:1px solid var(--hair);
  border-radius:16px;
  background:rgba(8,10,14,.92);
  backdrop-filter:blur(16px);
  box-shadow:0 20px 40px rgba(0,0,0,.28);
  color:var(--text);
  pointer-events:none;
}
body[data-theme="light"] .history-tooltip{
  background:rgba(255,255,255,.94);
}
.history-tooltip__title{
  font-weight:700;
  font-size:12px;
  margin-bottom:8px;
  color:var(--muted);
}
.history-tooltip__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
}
.history-tooltip__row + .history-tooltip__row{
  margin-top:6px;
}
.history-tooltip__label{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.history-tooltip__dot{
  width:8px;
  height:8px;
  border-radius:999px;
  display:inline-block;
}
.history-legend{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}
.history-legend--single{
  justify-content:flex-end;
}
.history-legend__item{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.history-legend__swatch{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
}
.history-legend__swatch--weight{
  background:#ecc465;
  box-shadow:0 0 0 4px rgba(236,196,101,.18);
}
.history-legend__swatch--calories{
  background:#b8ff4a;
  box-shadow:0 0 0 4px rgba(184,255,74,.16);
}
.history-legend__swatch--protein{
  background:#4cc9f0;
  box-shadow:0 0 0 4px rgba(76,201,240,.16);
}
.history-legend__swatch--carbs{
  background:#ffb703;
  box-shadow:0 0 0 4px rgba(255,183,3,.16);
}
.history-legend__swatch--fats{
  background:#fb7185;
  box-shadow:0 0 0 4px rgba(251,113,133,.16);
}
.history-empty{
  display:grid;
  place-items:center;
  min-height:220px;
  color:var(--muted);
  text-align:center;
  font-size:14px;
}
.auth-logo{
  display:flex;
  justify-content:center;
  margin-bottom:14px;
}
.brand-logo--auth{
  width:72px;
  height:72px;
  border-radius:22px;
  box-shadow:0 18px 40px rgba(0,0,0,.22);
}
.mini{
  border:1px solid var(--hair);
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,.04);
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
}
.mini-k{ color:var(--muted); font-size:12px; }
.mini-v{ font-weight:700; font-size:14px; }

.cta-row{ margin-top:16px; display:flex; gap:10px; flex-wrap:wrap; }
.cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.18);
  background:linear-gradient(135deg, var(--accent), #b97a35);
  color:#0b0d12;
  font-weight:800;
  letter-spacing:.15px;
  cursor:pointer;
  transition:transform .15s ease, filter .15s ease;
}
.cta:hover{ transform:translateY(-1px); filter:saturate(1.1); }
.cta.ghost{
  background:transparent;
  border:1px solid var(--hair);
  color:var(--text);
  font-weight:700;
}
.cta.ghost:hover{ background:var(--panel); }

.chat-shell{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:auto 1fr auto;
}
.chat-topbar{
  padding:14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border-bottom:1px solid var(--hair);
  background:rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
body[data-theme="light"] .chat-topbar{ background:rgba(255,255,255,.65); }
.back{
  font-size:13px;
  color:var(--muted);
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--hair);
  background:rgba(255,255,255,.04);
}
.back:hover{ background:var(--panel); }
.chat-title__name{ font-family:var(--font-display); font-weight:800; letter-spacing:.2px; }
.chat-title__sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.chat-stream{
  position:relative;
  overflow:hidden;
  min-height:0;
  isolation:isolate;
  z-index:1;
}
.chat-stream__inner{
  height:100%;
  min-height:0;
  overflow:auto;
  padding:18px 14px calc(110px + env(safe-area-inset-bottom));
  display:flex;
  flex-direction:column;
  gap:12px;
  -webkit-overflow-scrolling:touch;
}
.chat-stream__inner::after{
  content:"";
  display:block;
  flex:0 0 1px;
  min-height:1px;
  pointer-events:none;
  visibility:hidden;
}
.chat-empty{
  width:min(620px, 100%);
  margin:auto;
  border:1px solid var(--hair);
  border-radius:22px;
  padding:20px;
  background:rgba(255,255,255,.05);
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.chat-empty__title{
  font-family:var(--font-display);
  font-size:24px;
  font-weight:800;
}
.chat-empty__text{
  margin-top:8px;
  color:var(--muted);
  line-height:1.5;
}

.chat-date-separator{
  width:max-content;
  max-width:min(92%, 520px);
  margin: 18px auto 10px;
  padding: 6px 14px;
  border:1px solid var(--hair);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:var(--muted);
  font-size: 12.5px;
  line-height: 1.2;
  text-align:center;
  backdrop-filter:blur(14px);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  position:relative;
  white-space:nowrap;
}
.chat-date-separator::before,
.chat-date-separator::after{
  content:"";
  position:absolute;
  top:50%;
  height:1px;
  width: min(22vw, 160px);
  background: linear-gradient(90deg, transparent, var(--hair) 30%, var(--hair) 70%, transparent);
}
.chat-date-separator::before{ left: calc(100% + 12px); }
.chat-date-separator::after{ right: calc(100% + 12px); transform: scaleX(-1); }
body[data-theme="light"] .chat-date-separator{ background: rgba(17,24,39,.04); }

.bubble{
  max-width:min(860px, 100%);
  position:relative;
  overflow:visible;
  padding:10px 12px 8px;
  border-radius:20px;
  border:1px solid var(--hair);
  background:rgba(255,255,255,.05);
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
  touch-action:manipulation;
  will-change:transform;
}
.bubble--active{
  z-index:14;
  transform:scale(1.06);
  box-shadow:0 28px 64px rgba(0,0,0,.44);
  border-color:rgba(236,196,101,.48);
  filter:saturate(1.05);
}
.bubble.user{
  margin-left:auto;
  width:auto;
  max-width:min(520px, 68%);
  /*background:linear-gradient(180deg, #0b2a9c, rgb(255, 255, 255));color antiguo */
  background:#0b2a9c;
  border-radius:22px;
}
html body[data-theme="light"] .bubble.user{
  background: var(--accent) !important;
  border-color: rgba(0,0,0,.10) !important;
  color: #1a1200;
}
html body[data-theme="light"] .bubble.user .bubble-content,
html body[data-theme="light"] .bubble.user .bubble-content * {
  color: #1a1200 !important;
}
html body[data-theme="light"] .bubble.user .bubble-meta,
html body[data-theme="light"] .bubble.user .bubble-meta * {
  color: rgba(26,18,0,.70) !important;
}
html body[data-theme="light"] .bubble.user code,
html body[data-theme="light"] .bubble.user pre {
  background: rgba(0,0,0,.10) !important;
}
.bubble.ai{
  margin-right:auto;
  width:min(860px, 100%);
  max-width:min(860px, 100%);
  padding-inline:0;
  padding-top:0;
  border:none;
  background:transparent;
  box-shadow:none;
}
.bubble-meta{ display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom:6px; }
.bubble.ai .bubble-meta{
  padding-inline:0;
}
.bubble.user .bubble-meta{
  margin-bottom:4px;
}
.bubble-role{ font-size:12px; color:var(--muted); }
.bubble-actions{
  position:absolute;
  bottom:calc(100% + 10px);
  right:0;
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:170px;
  padding:8px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:22px;
  background:rgba(20,22,28,.88);
  box-shadow:0 26px 50px rgba(0,0,0,.36);
  backdrop-filter:blur(20px);
  opacity:0;
  pointer-events:none;
  transform:translateY(8px) scale(.97);
  transition:opacity .18s ease, transform .18s ease;
}
body[data-theme="light"] .bubble-actions{
  background:rgba(255,255,255,.92);
  border-color:rgba(0,0,0,.08);
}
.bubble.ai .bubble-actions{
  left:0;
  right:auto;
}
.bubble:hover .bubble-actions,
.bubble--active .bubble-actions,
.bubble-actions--open{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0) scale(1);
}
.bubble-actions::after{
  content:"";
  position:absolute;
  top:100%;
  width:0;
  height:0;
  border:8px solid transparent;
  border-top-color:rgba(20,22,28,.88);
  right:20px;
}
body[data-theme="light"] .bubble-actions::after{
  border-top-color:rgba(255,255,255,.92);
}
.bubble.ai .bubble-actions::after{
  right:auto;
  left:20px;
}
.mini-btn{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  border-radius:16px;
  padding:10px 12px;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  text-align:left;
}
.mini-btn svg{
  width:18px;
  height:18px;
  flex:0 0 auto;
  stroke:currentColor;
  stroke-width:1.9;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.mini-btn:hover{
  background:rgba(255,255,255,.08);
}
body[data-theme="light"] .mini-btn:hover{
  background:rgba(0,0,0,.05);
}
.mini-btn--danger{
  color:#ff8ea7;
}
.mini-btn--danger:hover{
  background:rgba(255,61,113,.12);
  color:#ffb4c5;
}

.bubble-content{ line-height:1.45; font-size:14px; white-space:pre-wrap; }
.bubble-content,
.bubble-content *{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}
.bubble.user .bubble-content{
  font-size:15px;
  line-height:1.42;
}
.bubble.ai .bubble-content{
  font-size:15px;
  line-height:1.62;
}
.bubble-content p{ margin:0 0 10px; }
.bubble-content p:last-child{ margin-bottom:0; }
.bubble-content code{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding:2px 6px;
  border-radius:10px;
  background:rgba(0,0,0,.25);
  border:1px solid var(--hair);
}
body[data-theme="light"] .bubble-content code{ background:rgba(0,0,0,.06); }

.bubble-error__details{
  margin-top:12px;
  padding-top:10px;
  border-top:1px dashed rgba(255,255,255,.14);
  font-size:11px;
  line-height:1.5;
  color:rgba(255,255,255,.42);
  word-break:break-word;
  -webkit-user-select:text;
  user-select:text;
}
.bubble-error__details-label{
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:10px;
  opacity:.85;
}
.bubble-error__details code{
  display:inline-block;
  margin-top:4px;
  font-size:10.5px;
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.08);
  padding:3px 7px;
  max-width:100%;
  overflow-wrap:break-word;
  white-space:pre-wrap;
}
body[data-theme="light"] .bubble-error__details{
  border-top-color:rgba(0,0,0,.10);
  color:rgba(26,18,0,.52);
}
body[data-theme="light"] .bubble-error__details code{
  background:rgba(0,0,0,.05);
  border-color:rgba(0,0,0,.08);
}

@media (hover:none){
  .bubble:hover .bubble-actions{
    opacity:0;
    pointer-events:none;
    transform:translateY(4px);
  }
}

.bubble-img{
  width:100%;
  height:auto;
  border-radius:14px;
  border:1px solid var(--hair);
  display:block;
}
.bubble-img-cap{
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
}

:root{
  --composer-offset-bottom: 0px;
  --composer-height: 72px;
  --typing-bottom: 10px;
}
.typing{
  position:fixed;
  left:14px;
  right:14px;
  bottom: calc(var(--composer-offset-bottom, 0px) + var(--composer-height, 72px) + var(--typing-bottom, 10px));
  z-index:70;
  display:flex;
  align-items:center;
  gap:10px;
  max-width:860px;
  margin:0 auto;
  background:rgba(0,0,0,.3);
  border:1px solid var(--hair);
  border-radius:999px;
  padding:10px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: bottom .18s ease, transform .18s ease, opacity .18s ease;
  transform: translateY(0);
}
.typing[hidden]{
  display:none !important;
}
body[data-theme="light"] .typing{ background:rgba(255,255,255,.75); }
.typing-dot{
  width:7px; height:7px; border-radius:999px;
  background:var(--accent);
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2){ animation-delay:.2s; }
.typing-dot:nth-child(3){ animation-delay:.4s; }
.typing-text{
  font-size:12.5px;
  color:var(--muted);
  min-width:0;
  line-height:1.2;
  flex:1 1 auto;
  transition: opacity .25s ease;
}
@keyframes blink{ 0%,100%{ transform:translateY(0); opacity:.4 } 50%{ transform:translateY(-3px); opacity:1 } }

:root{
  --composer-offset-bottom: 0px;
  --composer-padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.composer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--composer-offset-bottom, 0px);
  z-index: 200;
  /*background: rgba(0,0,0,.80); fondo composer footer*/
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  padding: 8px 12px var(--composer-padding-bottom, calc(10px + env(safe-area-inset-bottom, 0px)));
  transition: bottom .14s ease, padding-bottom .14s ease;
  isolation:isolate;
  contain: layout paint style;
  border-top:0.5px solid var(--hair);
}
.composer-input,textarea.composer-input,input.composer-input{
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@supports (-webkit-touch-callout: none) {
  .composer {
    padding-bottom: var(--composer-padding-bottom, 10px);
  }
}
body[data-theme="light"] .composer{ background: rgba(255,255,255,.94); }
.composer-form{
  display:grid;
  grid-template-columns: auto minmax(0,1fr) auto auto;
  grid-auto-flow: column;
  grid-template-areas: "attach input voice send";
  column-gap:8px;
  row-gap:0;
  align-items:end;
  justify-items:stretch;
  max-width:860px;
  width:100%;
  box-sizing: border-box;
  margin:0 auto;
  padding:6px 6px 6px 8px;
  border:1px solid var(--hair);
  border-radius:28px;
  background:rgba(255,255,255,.05);
  box-shadow:0 12px 30px rgba(0,0,0,.14);
}
.composer-form > *{ box-sizing: border-box; }
.composer-file,
.composer-audio-input{
  display:none !important;
  visibility:hidden !important;
  position:absolute !important;
  top:-99999px !important;
  left:-99999px !important;
  width:0 !important;
  height:0 !important;
  opacity:0 !important;
  pointer-events:none !important;
}
.attach-btn{ grid-area: attach; align-self: center; }
.composer-input{ grid-area: input; align-self: stretch; justify-self: stretch; min-width: 0; overflow-wrap: anywhere; }
.voice-btn{ grid-area: voice; align-self: end; justify-self: end; }
.send-btn-circle{ grid-area: send; align-self: end; justify-self: end; margin-bottom: 2px; }
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}
.icon-btn{
  border-radius:14px;
  border:1px solid var(--hair);
  background:var(--panel);
  color:var(--text);
  width:42px;
  height:42px;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.icon-btn:hover{ background:var(--panel-2); }
.attach-btn{
  border-radius:999px;
  border:1px solid var(--hair);
  background:var(--panel);
  color:var(--text);
  width:36px;
  min-width:36px;
  height:36px;
  cursor:pointer;
  display:grid;
  place-items:center;
  padding:0;
  flex:0 0 auto;
}
.attach-btn:hover{ background:var(--panel-2); }
.attach-btn__icon{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.icon{ font-size:18px; font-weight:700; }
.composer-input{
  width:100%;
  resize:none;
  min-height:22px;
  border:none;
  background:transparent;
  color:var(--text);
  padding:8px 4px;
  outline:none;
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.35;
  max-height:160px;
  z-index:2;
  position:relative;
  pointer-events:auto;
  touch-action:manipulation;
}
.composer-input:focus{ box-shadow:none; }
.composer-input::placeholder{ color:var(--muted); }
.composer-form > button,
.composer-form > label{
  touch-action:manipulation;
  pointer-events:auto;
  position:relative;
  z-index:2;
}

.voice-btn{
  position:relative;
  width:36px; height:36px; min-width:36px; border-radius:999px;
  display:grid; place-items:center;
  background:rgba(255,255,255,.04);
  border:1px solid var(--hair);
  color:var(--muted);
  padding:0;
  cursor:pointer;
  overflow:visible;
  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
.voice-btn:hover{ color:var(--text); background:var(--panel-2); }
.voice-btn:active{ transform: translateY(1px); }
.voice-btn__icon{
  width:20px; height:20px; color:inherit;
}
.voice-btn__waves{
  position:absolute; inset:-2px;
  border-radius:999px;
  pointer-events:none;
  display:none;
}
.voice-btn.is-recording{
  background:rgba(255,61,113,.14);
  border-color:rgba(255,61,113,.45);
  color:#ff5a85;
}
.voice-btn.is-recording .voice-btn__waves{ display:block; }
.voice-btn__waves i{
  position:absolute; left:50%; top:50%;
  width:28px; height:28px; margin-left:-14px; margin-top:-14px;
  border-radius:999px;
  border:2px solid rgba(255,61,113,.45);
  animation: voiceWave 1.4s infinite ease-out;
}
.voice-btn__waves i:nth-child(2){ animation-delay:.32s; }
.voice-btn__waves i:nth-child(3){ animation-delay:.64s; }
.voice-btn__waves i:nth-child(4){ animation-delay:.96s; }
@keyframes voiceWave{
  0%{ transform: scale(.8); opacity:.9; }
  100%{ transform: scale(1.8); opacity:0; }
}

.send-btn-circle{
  position:relative;
  width:38px; height:38px; min-width:38px;
  border-radius:999px;
  border:none;
  background:linear-gradient(135deg, #2e60ff, #5183ff);
  color:#fff;
  display:grid; place-items:center;
  padding:0;
  cursor:pointer;
  box-shadow:0 8px 20px rgba(46,96,255,.28), inset 0 -2px 0 rgba(0,0,0,.08);
  transition: transform .12s ease, opacity .15s ease, background .2s ease;
}
html body[data-theme="light"] .send-btn-circle{
  background: var(--accent) !important;
  color: #1a1200;
  box-shadow: 0 8px 20px rgba(236,196,101,.30), inset 0 -2px 0 rgba(0,0,0,.08);
}
.send-btn-circle:hover{ filter:brightness(1.04); }
.send-btn-circle:active{ transform: translateY(1px); }
.send-btn-circle:disabled{ opacity:.55; cursor:not-allowed; box-shadow:none; }
.send-btn-circle__icon{
  width:18px; height:18px; color:currentColor;
}
.send-btn{ display:none; }
.send-btn:disabled{ opacity:.55; cursor:not-allowed; }
.composer-hint{ display:none; }

.dropzone{
  position:absolute;
  left:14px;
  right:14px;
  bottom:68px;
  display:grid;
  place-items:center;
  z-index:5;
  pointer-events:none;
}
.dropzone-inner{
  width:min(460px, 100%);
  border:1px dashed rgba(184,255,74,.5);
  border-radius:20px;
  padding:18px;
  background:rgba(0,0,0,.78);
  box-shadow:0 16px 40px rgba(0,0,0,.35);
  text-align:center;
}
.dropzone-title{ font-weight:800; }
.dropzone-sub{ margin-top:6px; color:var(--muted); font-size:13px; }

.composer-menu{
  max-width:860px;
  margin:0 auto 10px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.composer-menu__item{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--hair);
  background:var(--panel);
  color:var(--text);
  border-radius:18px;
  padding:10px 12px;
  cursor:pointer;
  font:inherit;
  text-align:left;
}
.composer-menu__item:hover{ background:var(--panel-2); }
.composer-menu__item svg{
  width:18px;
  height:18px;
  flex:0 0 auto;
  stroke:currentColor;
  fill:none;
}

.composer-recorder{
  max-width:860px;
  margin:0 auto 10px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--hair);
  border-radius:22px;
  background:rgba(255, 61, 113, 0.10);
  color:var(--text);
}
.composer-recorder__dot{
  width:10px; height:10px; border-radius:999px; background:var(--danger);
  box-shadow:0 0 0 0 rgba(255, 61, 113, 0.6);
  animation: voicePulse 1.1s infinite;
  flex:0 0 auto;
}
@keyframes voicePulse{
  0%{ box-shadow:0 0 0 0 rgba(255, 61, 113, 0.6); }
  70%{ box-shadow:0 0 0 14px rgba(255, 61, 113, 0); }
  100%{ box-shadow:0 0 0 0 rgba(255, 61, 113, 0); }
}
.composer-recorder__label{ font-weight:700; }
.composer-recorder__time{ margin-left:auto; color:var(--muted); font-variant-numeric: tabular-nums; }
.composer-recorder__stop{
  width:34px; height:34px; border-radius:999px; border:none; cursor:pointer;
  background:var(--danger); color:#fff; display:grid; place-items:center;
  position:relative;
}
.composer-recorder__stop::after{
  content:"";
  width:12px; height:12px; border-radius:3px; background:#fff;
}

.app-splash{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  background:
    radial-gradient(1200px 800px at 10% 10%, #3d4c83, transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(81,131,255,.12), transparent 60%),
    radial-gradient(1100px 700px at 50% 110%, rgba(255,61,113,.08), transparent 60%),
    var(--bg);
  transition: opacity 320ms ease, visibility 320ms ease;
}
body[data-theme="light"] .app-splash{
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(46,96,255,.16), transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(236,196,101,.14), transparent 60%),
    radial-gradient(1100px 700px at 50% 110%, rgba(255,61,113,.06), transparent 60%),
    var(--bg);
}
.app-splash--hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.app-splash__inner{
  display:grid;
  place-items:center;
  gap:22px;
}
.app-splash__logo{
  width:104px;
  height:104px;
  border-radius:28px;
  object-fit:cover;
  box-shadow: var(--shadow);
}
.app-splash__spinner{
  display:flex;
  align-items:center;
  gap:10px;
}
.app-splash__spinner span{
  width:10px;
  height:10px;
  border-radius:999px;
  background: var(--accent);
  opacity:.5;
  animation: splashBounce 1.1s infinite ease-in-out both;
}
body[data-theme="light"] .app-splash__spinner span{ background: var(--accent); }
.app-splash__spinner span:nth-child(2){ animation-delay: .16s; }
.app-splash__spinner span:nth-child(3){ animation-delay: .32s; }
@keyframes splashBounce{
  0%,80%,100%{ transform: scale(.7); opacity:.45; }
  40%{ transform: scale(1.05); opacity:1; }
}

.app-update-banner{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:14px;
  align-items:center;
  max-width:960px;
  margin:14px auto 0;
  padding:12px 14px;
  border-radius:18px;
  background:linear-gradient(135deg, rgba(81,131,255,.18), rgba(255,61,113,.16));
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
body[data-theme="light"] .app-update-banner{
  background:linear-gradient(135deg, rgba(46,96,255,.14), rgba(255,61,113,.12));
  border-color:rgba(0,0,0,.08);
}
.app-update-banner[hidden]{ display:none; }
.app-update-banner__icon{
  width:16px; height:16px; border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 0 6px rgba(236,196,101,.18);
}
.app-update-banner__text{
  display:flex; flex-direction:column; gap:2px; min-width:0;
  font-size:13px; line-height:1.35;
}
.app-update-banner__text strong{
  font-size:14px; letter-spacing:-0.01em;
}
.app-update-banner__text span{
  color:var(--muted);
}
.app-update-banner__actions{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end;
}
.app-update-banner__btn{
  appearance:none;
  border:none;
  border-radius:999px;
  padding:10px 14px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.app-update-banner__btn:active{ transform: translateY(1px); }
.app-update-banner__btn--primary{
  background:var(--accent);
  color:#111;
}
.app-update-banner__btn--ghost{
  background:rgba(255,255,255,.06);
  color:var(--text);
  border:1px solid var(--hair);
}
body[data-theme="light"] .app-update-banner__btn--ghost{
  background:rgba(0,0,0,.04);
}

@media (max-width: 720px){
  .app-update-banner{ grid-template-columns:auto 1fr; }
  .app-update-banner__actions{
    grid-column:1 / -1;
    justify-content:flex-start;
  }
}

@media (max-width: 520px){
  .composer-menu__item{ font-size:14px; }
}

.auth-card{
  max-width:520px;
  margin:28px auto 0;
  background:rgba(255,255,255,.05);
  border:1px solid var(--hair);
  border-radius:22px;
  padding:18px;
  box-shadow:var(--shadow);
}
.auth-title{ font-family:var(--font-display); font-weight:900; font-size:22px; }
.auth-sub{ color:var(--muted); margin-top:4px; }
.auth-form{ margin-top:16px; display:flex; flex-direction:column; gap:12px; }
.field span{ display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
.field input,
.field select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--hair);
  background:rgba(255,255,255,.04);
  color:var(--text);
  outline:none;
}
.field input:focus,
.field select:focus{ border-color:rgba(184,255,74,.55); box-shadow:0 0 0 4px #0b2a9c; }
.auth-foot{ margin-top:12px; color:var(--muted); font-size:12px; }

.admin-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  margin-bottom:12px;
}
.admin-head--compact{
  align-items:flex-start;
}
.admin-title{ font-family:var(--font-display); font-weight:900; font-size:22px; }
.admin-sub{ margin-top:4px; color:var(--muted); font-size:13px; }
.card{
  border:1px solid var(--hair);
  border-radius:22px;
  background:rgba(255,255,255,.04);
  padding:16px;
}
.card-title{ font-weight:900; }
.card-sub{ color:var(--muted); margin-top:6px; }
.profile-layout{
  display:grid;
  grid-template-columns:minmax(0, 1.45fr) minmax(280px, .8fr);
  gap:18px;
  align-items:start;
}
.profile-card{
  min-width:0;
}
.profile-form{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
.password-form{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
.field--full,
.profile-actions{
  grid-column:1 / -1;
}
.profile-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.profile-aside{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.profile-stats{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:14px;
}
.admin-inline-form{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-end;
}
.admin-table-wrap{
  margin-top:14px;
  overflow:auto;
}
.admin-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.admin-table th{
  padding:0 10px;
  text-align:left;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.admin-table td{
  padding:12px 10px;
  vertical-align:top;
  background:rgba(255,255,255,.04);
  border-top:1px solid var(--hair);
  border-bottom:1px solid var(--hair);
}
.admin-table td:first-child{
  border-left:1px solid var(--hair);
  border-top-left-radius:16px;
  border-bottom-left-radius:16px;
}
.admin-table td:last-child{
  border-right:1px solid var(--hair);
  border-top-right-radius:16px;
  border-bottom-right-radius:16px;
}
.cell-strong{
  font-weight:800;
}
.cell-muted{
  color:var(--muted);
  font-size:12px;
}
.icon-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.icon-actions form{
  margin:0;
}
.icon-action-btn{
  border-radius:14px;
  border:1px solid var(--hair);
  background:var(--panel);
  color:var(--text);
  width:40px;
  height:40px;
  padding:0;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease, border-color .15s ease;
}
.icon-action-btn:hover{
  background:var(--panel-2);
  transform:translateY(-1px);
}
.icon-action-btn svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.icon-action-btn--primary{
  background:linear-gradient(135deg, #0b2a9c, rgba(81,131,255,.55));
  color:#0b0d12;
  border-color:transparent;
}
.icon-action-btn--danger{
  color:var(--danger);
}
.admin-modal{
  position:fixed;
  inset:0;
  z-index:90;
  display:grid;
  place-items:center;
  padding:20px;
}
.admin-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.48);
  backdrop-filter:blur(4px);
}
.admin-modal__dialog{
  position:relative;
  z-index:1;
  width:min(720px, 100%);
  max-height:min(88vh, 860px);
  overflow:auto;
  box-shadow:var(--shadow);
}
.admin-modal__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}
.admin-modal__form{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
.admin-modal__actions{
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:6px;
}
.food-photo-card{
  border:1px solid var(--hair);
  border-radius:18px;
  background:rgba(255,255,255,.04);
  padding:14px;
  display:grid;
  gap:12px;
}
.food-photo-card__head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.food-photo-card__preview{
  border:1px solid var(--hair);
  border-radius:16px;
  overflow:hidden;
  background:rgba(0,0,0,.14);
}
.food-photo-card__preview img{
  width:100%;
  max-height:280px;
  object-fit:contain;
  display:block;
}
.food-photo-card__status{
  margin-top:0;
}
body.modal-open{
  overflow:hidden;
}

@media (max-width: 900px){
  body.has-app-shell{ overflow:auto; }
  body.has-app-shell.has-chat-page{ overflow:hidden; }
  .app-shell{
    display:block;
    min-height:100dvh;
    height:100dvh;
  }
  .app-sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:min(84vw, 320px);
    transform:translateX(-100%);
    transition:transform .22s ease;
    box-shadow:0 20px 60px rgba(0,0,0,.35);
  }
  .app-shell[data-sidebar-mobile="open"] .app-sidebar{
    transform:translateX(0);
  }
  .app-shell[data-sidebar-state="collapsed"] .app-sidebar{
    width:min(84vw, 320px);
    padding-inline:14px;
  }
  .app-shell[data-sidebar-state="collapsed"] .app-brand__text,
  .app-shell[data-sidebar-state="collapsed"] .app-nav__label,
  .app-shell[data-sidebar-state="collapsed"] .app-user__meta{
    display:flex;
  }
  .app-shell[data-sidebar-state="collapsed"] .app-nav__item,
  .app-shell[data-sidebar-state="collapsed"] .app-logout,
  .app-shell[data-sidebar-state="collapsed"] .app-user{
    justify-content:flex-start;
  }
  .app-mobilebar{
    position:sticky;
    top:0;
    z-index:10;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-height:64px;
    padding:calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom:1px solid var(--hair);
    background:rgba(8,10,14,.82);
    backdrop-filter: blur(16px);
  }
  body.is-standalone .app-mobilebar{
    padding-top:calc(10px + env(safe-area-inset-top));
  }
  body[data-theme="light"] .app-mobilebar{
    background:rgba(255,255,255,.86);
  }
  .app-mobilebar__brand{
    font-family:var(--font-display);
    font-weight:800;
  }
  .app-main__content{
    overflow:visible;
  }
  body.has-chat-page .app-main__content{
    overflow:hidden;
  }
  .shell{
    padding:18px 14px 28px;
  }
  .profile-layout{
    grid-template-columns:1fr;
  }
  .profile-form{
    grid-template-columns:1fr;
  }
  .password-form{
    grid-template-columns:1fr;
  }
  .profile-actions{
    align-items:flex-start;
    flex-direction:column;
  }
  .admin-modal{
    padding:12px;
  }
  .admin-modal__form{
    grid-template-columns:1fr;
  }
  .hero-top{
    display:none;
  }
  .chat-topbar{
    display:none;
  }
  .chat-shell{
    height:calc(100dvh - 64px - env(safe-area-inset-top));
    min-height:calc(100dvh - 64px - env(safe-area-inset-top));
    grid-template-rows:1fr auto;
  }
  .chat-stream__inner{
    padding:14px 12px calc(108px + env(safe-area-inset-bottom));
  }
  .hero-grid{ grid-template-columns:1fr; }
  .summary-grid{ grid-template-columns:1fr 1fr; }
  .history-filters{
    grid-template-columns:1fr 1fr;
  }
  .history-charts{
    grid-template-columns:1fr;
  }
  .history-filters__presets{
    grid-column:1 / -1;
  }
  .admin-head{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 520px){
  .app-mobilebar{
    min-height:60px;
    padding:calc(10px + env(safe-area-inset-top)) 12px 10px;
  }
  .theme-toggle__label{
    display:none;
  }
  .hero-card,
  .card,
  .auth-card{
    border-radius:18px;
    padding:14px;
  }
  .summary-grid{ grid-template-columns:1fr; }
  .history-filters{
    grid-template-columns:84px minmax(0, 1fr) minmax(0, 1fr);
    gap:8px;
    align-items:center;
  }
  .history-filters .field span{
    display:none;
  }
  .history-filters .field input,
  .history-filters .field select{
    min-height:38px;
    padding:8px 10px;
    font-size:13px;
  }
  .history-filters .cta{
    min-height:38px;
    padding:8px 10px;
    font-size:13px;
  }
  .history-filters__presets{
    grid-column:1 / span 2;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .history-filters > .cta[type="submit"]{
    grid-column:3;
    width:100%;
  }
  .history-chart-card__head{
    flex-direction:column;
    align-items:flex-start;
  }
  .cta-row{ flex-direction:column; }
  .send-btn{ width:78px; }
  .composer{
    padding:8px 10px calc(10px + env(safe-area-inset-bottom));
  }
  .composer-form{
    grid-template-columns:auto 1fr auto;
  }
  .composer-input{
    min-height:22px;
  }
  .bubble{
    max-width:100%;
  }
  .bubble.user{
    max-width:84%;
  }
  .bubble.ai{
    width:100%;
    max-width:100%;
  }
  .app-user,
  .app-nav__item,
  .app-logout{
    border-radius:16px;
  }
}
