/* TRAINCLAUDE — estética "editorial deportiva" clara (adenda 16 de la spec).
   Referencia canónica: handoff/mockup/TrainClaude App v2.dc.html.
   Sin librerías externas ni CDNs: la CSP los bloquea y la PWA funciona sin red. */

/* Tipografías autoalojadas (OFL). Variables: un fichero cubre todos los pesos. */
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/HankenGrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/HankenGrotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/SpaceGrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/SpaceGrotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f1efe9;
  --surface: #f6f4ef;
  --card: #ffffff;
  --line: #e7e4dd;
  --line-soft: #eeece5;
  --hair: #d8d5cd;
  --track: #e9e6df;
  --heat-empty: #edebe3;

  --ink: #17161a;
  --ink-2: #5f5e66;
  --muted: #8b8a92;
  --faint: #b3b1a9;

  --accent: #f04e23;
  --accent-dark: #d43e15;
  --accent-lift: #ff6a3d;   /* el acento sobre fondo negro */

  /* La marca (assets/brand.md). Vive siempre sobre su propio carbón, en placa
     aparte: así el naranja Claude de la chispa nunca se lee como un acento de la
     interfaz ni compite con --accent. */
  --brand-carbon: #0a0a0b;
  --brand-bone: #fafaf7;
  --brand-spark: #d97757;

  --black: #161519;
  --on-black-2: #c6c5cc;
  --on-black-muted: #9a99a2;
  --on-black-line: #2b2a30;
  --on-black-line-2: #3a393f;

  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --z1: #2563eb;
  --z2: #16a34a;
  --z3: #d97706;
  --z4: #ea580c;
  --z5: #dc2626;

  --r-lg: 22px;
  --r: 20px;
  --r-md: 16px;
  --r-sm: 14px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(23, 22, 26, 0.04);

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.hidden { display: none !important; }
.nums { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.red { color: var(--red); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--hair); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes typingDot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-3px); opacity: 1; } }

/* ── Cabeceras ──────────────────────────────────────────────────────── */
.appbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: calc(14px + var(--safe-top)) 28px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.appbar .brand { display: flex; align-items: center; gap: 9px; flex: none; }
/* Placa de marca: la misma proporción que el icono de la app (rx 23 de 100). */
.brand-ring { stroke: var(--brand-bone); }
.brand-spark { fill: var(--brand-spark); }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--brand-carbon);
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-name em { color: var(--accent); font-style: normal; }

.navpills { flex: 1; display: flex; justify-content: center; min-width: 0; }
.navpills .pills {
  display: flex;
  gap: 2px;
  background: var(--track);
  border-radius: var(--pill);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.navpills .pills::-webkit-scrollbar { display: none; }
.navpills a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink-2);
}
.navpills a svg { width: 15px; height: 15px; flex: none; }
.navpills a.active { background: var(--black); color: #fff; }

.appbar .tools { display: flex; align-items: center; gap: 12px; flex: none; }
.syncpill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 7px 13px;
  cursor: pointer;
  white-space: nowrap;
}
.syncpill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseDot 2.4s infinite;
  flex: none;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}

.appbar-compact {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(13px + var(--safe-top)) 16px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.appbar-compact .title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.appbar-compact .tools { display: flex; align-items: center; gap: 9px; }
.appbar-compact .syncpill { border: 0; background: none; padding: 0; font-size: 10px; }
.appbar-compact .syncpill .dot { width: 6px; height: 6px; }
.appbar-compact .avatar { width: 28px; height: 28px; font-size: 10px; }

/* ── Layout ─────────────────────────────────────────────────────────── */
main {
  flex: 1;
  overflow-y: auto;
  padding: 22px 32px 48px;
  -webkit-overflow-scrolling: touch;
}
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.view { display: flex; flex-direction: column; gap: 16px; }
.view.tight { gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.sm { gap: 8px; }
.stack.xs { gap: 6px; }

.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.cols.wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cols.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.cols.mini { grid-template-columns: 1fr 1fr; gap: 12px; }
.cols.small { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px; }
.cols.trend { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.between.top { align-items: flex-start; }
.between.wrapy { flex-wrap: wrap; }
.rowline { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.self-start { align-self: flex-start; }

/* ── Navegación móvil ───────────────────────────────────────────────── */
.tabbar {
  flex: none;
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 8px calc(8px + var(--safe-bottom));
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a span { font-size: 9.5px; font-weight: 700; }
.tabbar a.active { background: var(--black); color: #fff; }

/* ── Tarjetas ───────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.card.pad-sm { padding: 16px 18px; }
.card.pad-md { padding: 18px; }
.card.mini { border-radius: var(--r-md); padding: 13px; gap: 4px; }
.card.black {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
  box-shadow: none;
}
.card.black .card-label { color: var(--on-black-muted); }
.card.black .card-sub { color: var(--on-black-muted); }
.card.accent-border { border: 1.5px solid rgba(240, 78, 35, 0.5); }
.card.link { cursor: pointer; }
.card.empty {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  padding: 22px;
}

.card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-label.sm { font-size: 10px; letter-spacing: 0.06em; }
.card-title { font-size: 13px; font-weight: 800; }
.card-title .tech { color: var(--faint); font-weight: 600; font-size: 11px; }
.card-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.card-sub.xs { font-size: 10.5px; line-height: 1.35; }
.card-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.num {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.num.xl { font-size: 44px; }
.num.lg { font-size: 31px; }
.num.md { font-size: 27px; }
.num.sm { font-size: 21px; letter-spacing: -0.02em; }
.num.xs { font-size: 16px; letter-spacing: -0.01em; }
.heading {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.heading.lg { font-size: 21px; }

.info {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
}
.info.sm { width: 16px; height: 16px; font-size: 9px; }
.info:hover { border-color: var(--muted); color: var(--ink); }

/* ── Botones, chips y píldoras ──────────────────────────────────────── */
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--pill);
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.block { display: block; width: 100%; }
.btn.small { padding: 9px 16px; font-size: 12.5px; }
.btn.tiny { padding: 7px 14px; font-size: 11.5px; font-weight: 700; }
.btn.ghost {
  background: none;
  color: var(--ink-2);
  border: 1px solid var(--hair);
  font-weight: 700;
}
.btn.ghost:hover { background: var(--surface); color: var(--ink); }
.btn.dark { background: var(--black); }
.btn.dark:hover { background: #000; }
.btn.danger { background: none; border: 1px solid rgba(220, 38, 38, 0.35); color: var(--red); font-weight: 700; }
.btn.danger:hover { background: rgba(220, 38, 38, 0.06); }
.btn.dashed {
  background: none;
  border: 1.5px dashed #cfccc3;
  color: var(--ink-2);
  border-radius: var(--r);
  padding: 16px;
  font-weight: 700;
}
.btn.dashed:hover { background: var(--card); }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }
.btn-row.fill .btn { flex: 1; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  border-radius: var(--pill);
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.chip.active { background: var(--black); border-color: var(--black); color: #fff; }

.tag {
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--pill);
  padding: 5px 12px;
  background: var(--bg);
  color: var(--muted);
  white-space: nowrap;
}
.tag.sm { font-size: 10.5px; padding: 4px 10px; }
.tag.dark { background: var(--black); color: #fff; }
.tag.accent { background: var(--accent); color: #fff; }
.tag.green { background: rgba(22, 163, 74, 0.1); color: var(--green); }
.tag.amber { background: rgba(217, 119, 6, 0.1); color: var(--amber); }
.tag.red { background: rgba(220, 38, 38, 0.09); color: var(--red); }
.tag.lift { background: var(--accent-lift); color: var(--black); }

.reasons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.reason {
  font-size: 11px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 4px 10px;
}

.note {
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.note.green { background: rgba(22, 163, 74, 0.08); border: 1px solid rgba(22, 163, 74, 0.35); color: var(--green); }
.note.amber { background: rgba(217, 119, 6, 0.08); border: 1px solid rgba(217, 119, 6, 0.35); color: var(--amber); }
.note.red { background: rgba(220, 38, 38, 0.07); border: 1px solid rgba(220, 38, 38, 0.3); color: var(--red); }
.note.plain { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.card.black .note.green { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); color: #4ade80; }
.card.black .note.amber { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); color: #fbbf24; }

.bar { height: 7px; background: var(--track); border-radius: var(--pill); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--pill); }
.card.black .bar { background: var(--on-black-line); height: 5px; }
.card.black .bar i { background: var(--accent-lift); }

/* ── Hoy: saludo y stats heróicas ───────────────────────────────────── */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-title {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hero-date { font-size: 13px; color: var(--muted); }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-stat { display: flex; align-items: center; gap: 10px; }
.hero-stat .ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex: none;
}
.hero-stat .ico svg { width: 17px; height: 17px; }
.hero-stat .v {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-stat .v span { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.hero-stat .k { font-size: 11px; color: var(--muted); }

/* ── Gauge de readiness ─────────────────────────────────────────────── */
.gauge-card { align-items: center; gap: 8px; }
.gauge-card > .between { align-self: stretch; }
.gauge { position: relative; width: 170px; height: 152px; }
.gauge svg { position: absolute; top: -6px; left: 0; width: 170px; height: 170px; }
.gauge .center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 10px;
}
.gauge .cap {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-top: 3px;
}
.light-tag { font-size: 12px; font-weight: 800; border-radius: var(--pill); padding: 6px 14px; }
.light-tag.green { color: var(--green); background: rgba(22, 163, 74, 0.09); }
.light-tag.amber { color: var(--amber); background: rgba(217, 119, 6, 0.1); }
.light-tag.red { color: var(--red); background: rgba(220, 38, 38, 0.09); }
.light-tag.none { color: var(--muted); background: var(--surface); }
.advice { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; text-align: center; }

/* ── Coach: avatar rayo y tarjeta puente ────────────────────────────── */
.bolt { border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; }
.bolt.s36 { width: 36px; height: 36px; }
.bolt.s36 svg { width: 18px; height: 18px; }
.bolt.s34 { width: 34px; height: 34px; }
.bolt.s34 svg { width: 17px; height: 17px; }
.bolt.s30 { width: 30px; height: 30px; }
.bolt.s30 svg { width: 15px; height: 15px; }
.bolt.s26 { width: 26px; height: 26px; margin-top: 2px; }
.bolt.s26 svg { width: 13px; height: 13px; }

.coach-teaser { flex-direction: row; gap: 12px; align-items: flex-start; }
.coach-teaser .go { font-size: 12.5px; font-weight: 800; color: var(--accent); }
.livedot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }

/* ── Objetivo destacado ─────────────────────────────────────────────── */
.goal-hero .days {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent-lift);
  line-height: 1;
}
.goal-hero .unit { font-size: 13px; color: var(--on-black-muted); font-weight: 600; }
.goal-hero .arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--on-black-line-2);
  display: grid;
  place-items: center;
  flex: none;
}
.goal-hero .arrow svg { width: 14px; height: 14px; }
.goal-hero .proj { font-size: 11.5px; color: var(--on-black-2); line-height: 1.5; }
.goal-days-xl {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent-lift);
  line-height: 1;
}

/* ── Chat del coach ─────────────────────────────────────────────────── */
.chat-layout { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.chat-panel {
  flex: 2;
  min-width: 320px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 600px;
  padding: 0;
  gap: 0;
}
.chat-side { flex: 1; min-width: 250px; display: flex; flex-direction: column; gap: 16px; }
.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.chat-head .who { font-size: 14px; font-weight: 800; }
.chat-head .state { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.msg { display: flex; gap: 8px; }
.msg.me { justify-content: flex-end; }
.msg .bubble-wrap { max-width: 82%; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  border-radius: 16px 16px 16px 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.me .bubble {
  border-radius: 16px 16px 5px 16px;
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}
.msg.error .bubble { border-color: rgba(220, 38, 38, 0.4); color: var(--red); }
.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  padding: 13px 15px;
}
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typingDot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
.chat-chips { flex: none; display: flex; gap: 7px; flex-wrap: wrap; padding: 0 18px 12px; }
.chat-chips button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--pill);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.chat-compose {
  flex: none;
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
}
.chat-compose input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  padding: 11px 17px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  min-width: 0;
}
.send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--black);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.send svg { width: 17px; height: 17px; }
.send:disabled { opacity: 0.5; }

.ctx-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--on-black-line);
  padding-bottom: 9px;
}
.ctx-row span:first-child { color: var(--on-black-muted); }
.ctx-row span:last-child { font-weight: 700; text-align: right; }
.privacy { font-size: 11px; color: var(--on-black-muted); line-height: 1.55; }

/* ── Carga ──────────────────────────────────────────────────────────── */
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: block; }

.acwr-scale { position: relative; height: 26px; }
.acwr-scale .track {
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: var(--pill);
  overflow: hidden;
  display: flex;
}
.acwr-scale .track i { display: block; height: 100%; }
.acwr-scale .needle {
  position: absolute;
  top: 2px;
  width: 3px;
  height: 22px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
}
.scale-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }

.trio { display: flex; gap: 26px; flex-wrap: wrap; }
.trio > div { display: flex; flex-direction: column; gap: 2px; }
.trio .k { font-size: 11px; color: var(--muted); }

.heat { display: flex; gap: 4px; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.heat .dow { display: flex; flex-direction: column; gap: 4px; flex: none; margin-right: 4px; }
.heat .dow div { height: 15px; line-height: 15px; font-size: 9px; color: var(--faint); }
.heat .col { display: flex; flex-direction: column; gap: 4px; flex: none; }
.heat .cell { width: 15px; height: 15px; border-radius: 4.5px; background: var(--heat-empty); }
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--faint); }
.heat-legend i { width: 12px; height: 12px; border-radius: 3.5px; display: block; }

/* ── Plan ───────────────────────────────────────────────────────────── */
.day {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow);
}
.day.today { border-color: rgba(240, 78, 35, 0.5); }
.day.future { opacity: 0.85; }
.day.future .t1 { color: var(--ink-2); }
.day .dnum { width: 38px; flex: none; display: flex; flex-direction: column; align-items: center; }
.day .dnum .d { font-size: 10px; color: var(--faint); font-weight: 700; }
.day .dnum .n { font-family: var(--display); font-size: 17px; font-weight: 700; }
.day .t1 { font-size: 13.5px; font-weight: 700; }
.day .t2 { font-size: 11.5px; color: var(--muted); }
.day .clickable { cursor: pointer; }
.prop-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.prop-row .d { width: 22px; color: var(--faint); font-weight: 800; flex: none; }
.prop-row .t { flex: 1; min-width: 0; }
.prop-row .v { color: var(--muted); font-weight: 700; }

/* ── Actividades ────────────────────────────────────────────────────── */
.act {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.act .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.act .ico svg { width: 18px; height: 18px; }
.act .t1 {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.act .t2 { font-size: 11.5px; color: var(--muted); }
.act .end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.act .end .v { font-family: var(--display); font-size: 15px; font-weight: 700; }
.act .end .v small { font-size: 10px; color: var(--faint); font-weight: 600; }
.act .end .q { font-size: 11px; font-weight: 600; }

.streams { position: relative; cursor: crosshair; touch-action: pan-y; }
.streams svg { width: 100%; height: auto; display: block; }
.streams svg + svg { margin-top: 6px; }
.streams .cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(23, 22, 26, 0.4);
  pointer-events: none;
  display: none;
}
.readout {
  display: flex;
  gap: 13px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
  min-height: 17px;
}
.readout b { font-weight: 800; }
.axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }

.split { display: flex; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.split .k { width: 22px; color: var(--faint); font-weight: 700; flex: none; }
.split .track { flex: 1; height: 6px; background: var(--bg); border-radius: var(--pill); overflow: hidden; }
.split .track i { display: block; height: 100%; background: var(--ink); opacity: 0.85; border-radius: var(--pill); }
.split .p { width: 46px; text-align: right; font-weight: 800; }
.split .h { width: 58px; text-align: right; color: var(--red); }
.split .e { width: 48px; text-align: right; color: var(--muted); }

.zline { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.zline .z { width: 24px; font-weight: 800; flex: none; }
.zline .track { flex: 1; height: 9px; background: var(--bg); border-radius: var(--pill); overflow: hidden; }
.zline .track i { display: block; height: 100%; border-radius: var(--pill); }
.zline .t { width: 56px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ── Tendencias y objetivos ─────────────────────────────────────────── */
.delta { font-size: 12.5px; font-weight: 800; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--muted); }
.pred {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 9px;
}
.pred .t { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Ajustes ────────────────────────────────────────────────────────── */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact .k {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.fact .v { font-size: 15px; font-weight: 800; }
.fact .v small { font-size: 10px; color: var(--faint); font-weight: 500; }
.divider { border-top: 1px solid var(--line-soft); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }

.zone-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.zone-chip { font-size: 11.5px; font-weight: 800; border-radius: 9px; padding: 6px 10px; }

.switch-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.switch-row .t1 { font-size: 13px; font-weight: 700; }
.switch-row .t2 { font-size: 11px; color: var(--muted); }
.switch {
  width: 40px;
  height: 23px;
  border-radius: var(--pill);
  border: none;
  cursor: pointer;
  position: relative;
  background: var(--hair);
  flex: none;
  padding: 0;
}
.switch.on { background: var(--black); }
.switch i {
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
  box-shadow: 0 1px 2px rgba(23, 22, 26, 0.2);
}
.switch.on i { left: 19.5px; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.token-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--accent-dark);
  word-break: break-all;
}
.steps { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.steps b { color: var(--accent); font-weight: 800; }

.more-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.more-row svg { width: 18px; height: 18px; flex: none; }
.more-row .l { flex: 1; font-size: 14px; font-weight: 700; }
.more-row .c { color: var(--faint); font-size: 16px; }

/* ── Formularios ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
}
.input:focus, select:focus, textarea:focus { border-color: var(--hair); background: var(--card); }
textarea { min-height: 84px; resize: vertical; }
.err { color: var(--red); font-size: 12.5px; font-weight: 700; }
.ok { color: var(--green); font-size: 12.5px; font-weight: 700; }
.err:empty, .ok:empty { display: none; }

/* ── Login ──────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 22px; }
.login-head { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.login-head .mark {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  background: var(--brand-carbon);
  display: grid;
  place-items: center;
}
.login-head .mark svg { width: 40px; height: 40px; }
.login-head h1 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.login-head h1 em { color: var(--accent); font-style: normal; }
.login-head p { font-size: 13px; color: var(--muted); margin: 0; }
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--faint);
}
.login-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.switch-mode { font-size: 12.5px; color: var(--muted); text-align: center; }
.switch-mode button {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

/* ── Modal del glosario ─────────────────────────────────────────────── */
.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 26, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 24px 60px rgba(23, 22, 26, 0.25);
  max-height: 88vh;
  overflow-y: auto;
}
.sheet h3 { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0; }
.sheet .tech { font-size: 11px; color: var(--faint); }
.sheet p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }
.sheet .mine {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.5;
}
.sheet .close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

/* ── Varios ─────────────────────────────────────────────────────────── */
.loading { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--black);
  color: #fff;
  border-radius: var(--pill);
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  z-index: 120;
  box-shadow: 0 10px 30px rgba(23, 22, 26, 0.25);
  max-width: 90vw;
  text-align: center;
}
.chart { width: 100%; height: auto; display: block; }
.scrollx { overflow-x: auto; }

/* ── Escritorio: píldoras arriba, sin pestañas inferiores ───────────── */
@media (min-width: 760px) {
  .appbar-compact, .tabbar { display: none !important; }
}

/* ── Móvil: 5 pestañas abajo, sin barra de píldoras ─────────────────── */
@media (max-width: 759px) {
  .appbar { display: none !important; }
  main { padding: 14px 14px 24px; }
  .hero-title { font-size: 24px; }
  .chat-panel { height: 520px; }
  .cols, .cols.wide, .cols.trend { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}
