/* ═══ vistas ═══════════════════════════════════════════════════ */

/* ── HOY ────────────────────────────────────────────────────── */
.hero { padding: 14px 0 2px; overflow-x: clip; }
.hero-title { font-size: clamp(38px, 12vw, 60px); }
.hero-hello { display: block; margin-bottom: 4px; font-size: .4em; font-weight: 700; letter-spacing: -.02em; color: var(--text-2); }
.sel-frame { position: relative; display: inline-block; padding: 0 10px 6px; margin-left: -10px; outline: 1.5px solid var(--cyan); }
.sel-frame .h { position: absolute; width: 9px; height: 9px; background: var(--bg); border: 1.5px solid var(--cyan); }
.h.tl { left: -5px; top: -5px; } .h.tr { right: -5px; top: -5px; }
.h.bl { left: -5px; bottom: -5px; } .h.br { right: -5px; bottom: -5px; }
.sel-size {
  position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%);
  padding: 2px 6px; border-radius: 4px; background: var(--cyan); color: #06161b;
  font-size: 10px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
}
.cursor-tag { position: absolute; left: calc(100% - 4px); bottom: -24px; display: flex; align-items: flex-start; animation: cursorFloat 4s ease-in-out infinite; }
.cursor-tag svg path { fill: var(--pink); stroke: #fff; stroke-width: 1; }
.cursor-tag span { margin: 11px 0 0 -2px; padding: 2px 8px; border-radius: 2px 9px 9px 9px; background: var(--pink); color: #fff; font: 600 11px var(--f-body); letter-spacing: 0; }
.hero-sub { margin: 46px 0 0; max-width: 42ch; font-size: 15px; color: var(--text-2); }

.next-exam {
  margin-top: 16px; padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--pink) 38%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 12%, var(--surface)), var(--surface) 72%);
}
.next-exam-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.next-exam-top .eyebrow { margin: 0; color: var(--pink); }
.next-exam-when { font-size: 11px; color: var(--pink); background: color-mix(in srgb, var(--pink) 14%, transparent); padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.next-exam h2 { margin: 8px 0 4px; }
.next-exam p { margin: 0 0 12px; font-size: 13px; }
.next-exam-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.next-exam-actions .btn { flex: 1; min-width: 140px; }

.capture-bar {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px;
  padding: 12px 14px; border-radius: var(--r-m); text-align: left;
  border: 1px dashed var(--line-2); background: var(--surface);
  transition: border-color .2s, background .2s;
}
.capture-bar:hover { border-color: var(--accent); background: var(--surface-2); }
.capture-ico { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--surface-2)); }
.capture-bar b { display: block; font-size: 14px; }
.capture-bar small { display: block; font-size: 11.5px; color: var(--text-3); }
.capture-bar > .icon { color: var(--text-3); }

.app-credit { margin: 26px 0 0; padding: 8px 0 4px; display: flex; align-items: center; justify-content: center; gap: 12px; opacity: .82; }
.app-credit a { color: var(--text-3); font-size: 10px; }
.app-credit a:hover { color: var(--text); }

.now-card {
  position: relative; display: block; width: 100%; margin-top: 22px; padding: 16px 18px; overflow: hidden; text-align: left;
  border-radius: var(--r-l); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--surface)), var(--surface) 72%);
}
.now-card::after {
  content: ''; position: absolute; right: -34px; top: -34px; width: 128px; height: 128px; border-radius: 50%;
  border: 18px solid color-mix(in srgb, var(--c) 32%, transparent);
}
.now-next {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px;
  padding: 12px 14px; border-radius: var(--r-m); text-align: left;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line-2));
  background: var(--surface);
}
.now-next-ico { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
.now-next b { display: block; margin: 2px 0; font: 800 18px/1.05 var(--f-display); letter-spacing: -.02em; }
.now-next small { display: block; font-size: 11px; color: var(--text-2); }
.now-next .eyebrow { margin: 0; }
.now-next > .icon { color: var(--text-3); flex: none; }
.now-card .eyebrow { margin: 0; color: var(--text-2); }
.now-title { display: block; margin: 4px 0 6px; font: 800 27px/1.05 var(--f-display); letter-spacing: -.03em; }
.now-meta { font-size: 12px; color: var(--text-2); }
.now-progress { display: block; height: 6px; margin-top: 12px; border-radius: 6px; background: color-mix(in srgb, var(--c) 22%, transparent); overflow: hidden; }
.now-progress i { display: block; height: 100%; border-radius: 6px; background: var(--c); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--c); color: var(--c); animation: pulse 1.6s infinite; }

/* Tarjeta de setup de Hoy. No usa `.onboarding`: esa clase es la pantalla
   completa y su min-height:100dvh empujaba el dashboard una pantalla entera. */
.setup-card { margin-top: 22px; border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
.setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.setup-head .display-sm { margin: 2px 0 10px; }
.setup-card ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.setup-card li button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; text-align: left; }
.setup-card li button:not(:disabled):hover { background: var(--surface-2); }
.setup-card b { display: block; font-weight: 600; }
.setup-card small { font-size: 12px; color: var(--text-3); }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); font-size: 11.5px; font-weight: 600; }
.setup-card li.done .step-n { background: var(--mint); color: #06140e; }
.setup-card li.done b { color: var(--text-3); text-decoration: line-through; }

.week-card { margin-top: 18px; padding: 14px 12px 8px; }
.wc-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.wc-head .eyebrow { margin: 0; }
.wc-ratio { font-size: 11px; color: var(--text-2); }
.week-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 8px; }
.ws-day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 6px; border-radius: 14px; transition: background .2s; }
.ws-day:active { background: var(--surface-2); }
.ws-l { font-size: 10px; color: var(--text-3); }
.ws-bar { position: relative; width: 10px; height: 46px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.ws-bar i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 6px; background: var(--grad-v); background-size: 100% 46px; background-position: bottom; transition: height .6s var(--ease); }
.ws-n { font: 700 15px var(--f-display); }
.ws-day.today { background: var(--surface-3); }
.ws-day.today .ws-n { color: var(--accent); }
.ws-day.past { opacity: .45; }

.install-banner {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 10px 12px 16px; border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--cyan) 18%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent);
}
.install-banner > .icon { color: var(--cyan); flex: none; }
.install-banner b, .install-banner small { display: block; }
.install-banner small { font-size: 12px; color: var(--text-2); }

.tickets { margin-top: -4px; }

/* ── AGENDA ─────────────────────────────────────────────────── */
.month { padding: 12px 8px 10px; touch-action: pan-y; overflow: hidden; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-head span { padding-bottom: 6px; text-align: center; font-size: 10.5px; color: var(--text-3); }
.month-grid { row-gap: 2px; }
.month-grid.from-r { animation: slideL .3s var(--ease); }
.month-grid.from-l { animation: slideR .3s var(--ease); }
.day { position: relative; aspect-ratio: 1 / 1.08; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 13px; transition: background .15s; }
.day:active { background: var(--surface-2); }
.day-n { font: 600 15px var(--f-body); font-variant-numeric: tabular-nums; }
.day.out { opacity: .28; }
.day.weekend .day-n { color: var(--text-2); }
.day.today .day-n { color: var(--accent); font-weight: 800; }
.day.today::before { content: ''; position: absolute; inset: 3px; border-radius: 11px; border: 1.5px solid var(--accent); }
.day.sel { background: var(--text); }
.day.sel .day-n { color: var(--bg); }
.day.sel.today::before { border-color: var(--bg); }
.day-dots { display: flex; gap: 2px; height: 5px; }
.day-dots i { width: 5px; height: 5px; border-radius: 50%; }
.day-detail { margin-top: 24px; }
.day-detail > .stack + .stack { margin-top: 8px; }

/* ── HORARIO ────────────────────────────────────────────────── */
.schedule .segmented { margin-bottom: 4px; }
.tt { margin-top: 14px; padding: 10px 6px 10px 4px; overflow: hidden; }
.tt-head, .tt-body { display: grid; grid-template-columns: 26px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; }
.tt-head { padding-bottom: 8px; }
.tt-head span { padding: 4px 0; border-radius: 8px; text-align: center; font-size: 10.5px; color: var(--text-3); }
.tt-head span.today { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tt-body { position: relative; background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.tt-hours { display: flex; flex-direction: column; }
.tt-hours span { height: var(--hour); padding-right: 3px; text-align: right; font-size: 9.5px; color: var(--text-3); transform: translateY(-5px); }
.tt-hours span:first-child { transform: none; }
.tt-col { position: relative; border-radius: 8px; cursor: copy; }
.tt-col.today { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tt-block {
  position: absolute; left: 1px; right: 1px; z-index: 1;
  display: flex; flex-direction: column; gap: 1px; padding: 5px 4px 4px 6px; overflow: hidden; text-align: left;
  border-radius: 8px; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 28%, var(--surface));
  font-size: 10.5px; line-height: 1.2; transition: transform .15s var(--ease);
}
.tt-block:active { transform: scale(.96); }
.tt-block b { font-size: 11px; font-weight: 700; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tt-block small { font-size: 9.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-now { position: absolute; left: -2px; right: -2px; z-index: 2; height: 2px; background: var(--pink); pointer-events: none; }
.tt-now::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.day-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 16px 0; }
.day-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); transition: background .2s, color .2s; }
.day-tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.day-tabs i { min-height: 12px; font-size: 10px; font-style: normal; font-weight: 700; color: var(--accent); }
.day-sum { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.day-sum b { font: 700 20px var(--f-display); }
.day-sum span { font-size: 11px; }

/* ── MATERIAS: chips Pantone ────────────────────────────────── */
.pantone-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 560px) { .pantone-grid { grid-template-columns: repeat(3, 1fr); } }
.pantone {
  display: flex; flex-direction: column; overflow: hidden; text-align: left;
  border-radius: 6px 6px 14px 14px; background: #f7f5fb; box-shadow: var(--shadow-s);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .25s var(--spring);
}
.pantone:active { transform: rotate(-1.5deg) scale(.97); }
.pt-color { position: relative; aspect-ratio: 1 / .92; display: flex; align-items: flex-start; justify-content: space-between; padding: 10px; background: var(--c); color: var(--ink); }
.pt-code { font-size: 10px; opacity: .75; }
.pt-avg { font: 800 24px/1 var(--f-display); letter-spacing: -.03em; }
.pt-label { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; color: #120d20; }
.pt-brand { font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.pt-label b { font: 700 15px/1.15 var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.pt-meta { font-size: 10px; color: #5c5577; }
.pantone.add { align-items: center; justify-content: center; gap: 8px; min-height: 200px; background: transparent; border: 1.5px dashed var(--line-2); color: var(--text-2); box-shadow: none; }

.chip-preview { align-self: center; width: 150px; overflow: hidden; border-radius: 6px 6px 14px 14px; box-shadow: var(--shadow); transform: rotate(-3deg); transition: transform .3s var(--spring); }
.cp-color { height: 104px; padding: 8px; background: var(--c); font-size: 9px; color: rgba(0, 0, 0, .55); transition: background .3s; }
.cp-label { display: flex; flex-direction: column; padding: 8px 10px; background: #f7f5fb; color: #120d20; }
.cp-label b { font: 700 13px/1.2 var(--f-display); }
.cp-label span { font-size: 9.5px; color: #5c5577; }

.sd-hero { position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 22px var(--gutter) 22px; background: var(--c); color: var(--ink); }
.sd-hero > .mono { font-size: 10.5px; opacity: .8; }
.sd-hero .display { margin-top: 10px; font-size: 34px; padding-right: 90px; }
.sd-avg { position: absolute; right: var(--gutter); top: 20px; text-align: right; }
.sd-avg b { display: block; font: 800 30px/1 var(--f-display); }
.sd-avg small { font: 600 10px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.kv div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.kv dt { font: 600 10px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.kv dd { margin: 2px 0 0; font-weight: 600; }
.subject-detail .section-head { margin-top: 24px; }
.session-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.session-pill { padding: 7px 10px; border-radius: 9px; background: var(--surface-2); font-size: 12px; }

/* ── EXÁMENES ───────────────────────────────────────────────── */
.stat-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stat-card .eyebrow { margin: 0 0 4px; }
.stat-big { display: block; font: 800 46px/1 var(--f-display); letter-spacing: -.04em; }
.stat-scale { flex: 1; max-width: 210px; display: flex; flex-direction: column; gap: 8px; }
.scale-bar { position: relative; height: 8px; border-radius: 8px; background: var(--surface-3); }
.scale-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: var(--grad); }
.scale-bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); }

/* ── QUICK ADD ──────────────────────────────────────────────── */
.capture {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 18px;
  border: 1.5px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box;
}
.capture .input { min-height: 44px; padding: 0; border: 0; background: transparent; }
.capture .input:focus { box-shadow: none; }
.capture-ico { flex: none; color: var(--pink); }
.capture-preview { margin-top: 14px; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line-2); animation: rise .3s var(--ease) both; }
.capture-preview h3 { margin: 10px 0 4px; font: 700 20px/1.2 var(--f-display); letter-spacing: -.02em; }
.capture-preview p { margin: 0; font-size: 13px; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.type-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px;
  border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 14px;
  animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms); transition: transform .15s var(--ease), border-color .2s;
}
.type-card:active { transform: scale(.95); }
.type-card:hover { border-color: var(--c); }
.type-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); }

/* subtareas / IA en sheets */
.subtasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.subtasks li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.subtasks .check { width: 22px; height: 22px; border-radius: 7px; }
.subtasks .check svg { width: 15px; height: 15px; }
.subtasks .done { color: var(--text-3); text-decoration: line-through; }
.ai-target { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.ai-target > .icon { color: var(--pink); flex: none; }
.ai-target b { display: block; }
.ai-target span { font-size: 12px; }
.plan-list, .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; opacity: .5; transition: opacity .2s, border-color .2s; animation: rise .35s var(--ease) both; }
.plan-list li.on { opacity: 1; border-color: color-mix(in srgb, var(--cyan) 60%, transparent); }
.plan-date { display: flex; flex-direction: column; min-width: 74px; font-size: 11px; color: var(--text-2); }
.plan-date b { font-size: 15px; color: var(--text); }
.plan-list b, .plan-list small, .steps b, .steps small { display: block; }
.plan-list small, .steps small { font-size: 12px; }
.plan-check { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; border: 1.5px solid var(--line-2); color: transparent; }
.plan-list li.on .plan-check { background: var(--cyan); border-color: var(--cyan); color: #06161b; }
.tips { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--violet) 12%, transparent); border: 1px dashed color-mix(in srgb, var(--violet) 50%, transparent); }
.tips p { margin: 4px 0; font-size: 13.5px; }
.steps li { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); animation: rise .35s var(--ease) both; }

/* ── IA ─────────────────────────────────────────────────────── */
.tool {
  flex: none; width: 140px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: left;
  scroll-snap-align: start; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms);
  transition: transform .15s var(--ease), border-color .2s;
}
.tool:active { transform: scale(.96); }
.tool:hover { border-color: var(--c); }
.tool:disabled { opacity: .5; }
.tool-ico { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 12px; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); }
.tool b { font-size: 13.5px; line-height: 1.2; }
.tool small { font-size: 11.5px; color: var(--text-3); }
.chat { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.chat-end { height: 1px; scroll-margin-bottom: calc(var(--dock-h) + var(--safe-b) + 150px); }
.chat-empty .suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-empty .chip { min-height: 40px; }
.msg { display: flex; align-items: flex-end; gap: 8px; animation: rise .3s var(--ease) both; }
.msg.me { justify-content: flex-end; }
.msg-avatar { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: var(--grad); color: #fff; }
.bubble { position: relative; max-width: 86%; padding: 12px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--grad); color: #fff; border: 0; border-bottom-right-radius: 6px; }
.msg.ai .bubble { border-bottom-left-radius: 6px; }
.msg.error .bubble { border-color: var(--bad); color: var(--bad); }
.bubble p { margin: 0; }
.msg-img { max-height: 240px; margin-bottom: 8px; border-radius: 12px; object-fit: cover; }
.msg-copy { position: absolute; right: 8px; bottom: -13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.md h4 { margin: 12px 0 4px; font: 700 16px var(--f-display); letter-spacing: -.01em; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md li::marker { color: var(--pink); }
.md code { padding: 1px 5px; border-radius: 5px; background: var(--surface-3); font: 13px var(--f-mono); }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.hex { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: .9em; }
.hex::before { content: ''; width: 11px; height: 11px; border-radius: 3px; background: var(--c); border: 1px solid var(--line-2); }

.composer {
  position: fixed; z-index: 39; left: 0; right: 0; margin: 0 auto;
  bottom: calc(var(--safe-b) + var(--dock-h) + 20px);   /* dock (12 px de base) + 8 px de aire */
  width: min(calc(100% - 20px), 616px); padding: 6px;
  border-radius: 24px; background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
/* teclado abierto (html[data-kb], ver app.js): sin dock, el composer baja hasta el teclado */
[data-kb] .composer { bottom: 8px; }
[data-kb] .view-ia { padding-bottom: 96px; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.composer textarea { min-height: 46px; max-height: 140px; padding: 12px 6px; border: 0; background: transparent; resize: none; }
.composer textarea:focus { box-shadow: none; }
.composer .btn.icon-only { width: 46px; min-height: 46px; }
.composer .icon-btn { width: 46px; height: 46px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; }
.attach img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.attach span { flex: 1; color: var(--text-2); }

.palette-card { display: flex; flex-direction: column; gap: 8px; min-width: min(260px, 64vw); }
.pc-strip { display: flex; height: 120px; border-radius: 14px; overflow: hidden; }
.pc-strip button { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; transition: flex .3s var(--ease); }
.pc-strip button:hover, .pc-strip button:focus-visible { flex: 1.7; }
.pc-strip .mono { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; }
.pc-name { font: 700 18px var(--f-display); letter-spacing: -.01em; }
.palette-card > p { margin: 0; font-size: 13px; }
.pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.pc-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pc-list i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.pc-tip { margin: 0; font-size: 13px; color: var(--text-2); }
.pc-list li { display: block; }
.pc-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; margin: 0 -8px; border-radius: 10px; color: inherit; text-align: left; font-size: 13px; width: calc(100% + 16px); }
.pc-row:active { background: var(--surface-3); }
.pc-ci { flex: none; font-size: 10px; padding: 3px 6px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); }

/* ¿Cuánto necesito? (ficha de materia) */
.grade-goal { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.gg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gg-head .eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.gg-target { display: flex; align-items: center; gap: 6px; }
.gg-target .input { width: 76px; min-height: 44px; text-align: center; padding: 8px; }
.gg-verdict { margin: 0; font: 700 17px/1.3 var(--f-body); }
.gg-verdict.ok { color: var(--ok); }
.gg-verdict.mid { color: var(--orange); }
.gg-verdict.bad { color: var(--bad); }
.gg-meta { margin: 0; font-size: 13px; }
.gg-sim { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.gg-sim-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.gg-sim-row .ok { color: var(--ok); }
.gg-sim-row .bad { color: var(--bad); }
.gg-range { width: 100%; height: 44px; accent-color: var(--accent); }

.ai-setup { margin-top: 6px; }
.ai-intro .display-sm { margin-top: 0; }
.how { margin: 0; padding-left: 20px; color: var(--text-2); }
.how li { margin: 6px 0; }
.how li::marker { color: var(--pink); font-family: var(--f-mono); }
.key-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.key-item .mono { font-size: 13px; }
.key-usage { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11px; color: var(--text-3); }
.key-usage b { color: var(--text-2); }
.key-usage .off { color: var(--bad); }

/* ── AJUSTES ────────────────────────────────────────────────── */
.settings-section { margin-top: 14px; display: flex; flex-direction: column; gap: 16px; }
.ss-title { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 17px var(--f-display); letter-spacing: -.01em; }
.ss-title .icon { color: var(--accent); }
.accent-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.accent-swatch { height: 66px; display: flex; align-items: flex-end; padding: 7px; border-radius: 14px; background: var(--c); color: rgba(0, 0, 0, .7); transition: transform .25s var(--spring), box-shadow .2s; }
.accent-swatch .mono { font-size: 9px; line-height: 1.15; text-align: left; }
.accent-swatch.on { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.status-row { display: flex; align-items: center; gap: 12px; }
.status-row b { display: block; overflow-wrap: anywhere; }   /* emails largos no deben empujar el botón */
.status-row small { display: block; font-size: 12px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.bad { background: var(--bad); }
.btn-list { display: flex; flex-direction: column; gap: 6px; }
.list-btn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-align: left; transition: background .2s; }
.list-btn:hover { background: var(--surface-3); }
.list-btn b { display: block; font-weight: 600; }
.list-btn small { font-size: 12px; color: var(--text-3); }
.list-btn > .icon:first-child { color: var(--accent); flex: none; }
.list-btn.danger, .list-btn.danger > .icon:first-child { color: var(--bad); }
.credits { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 0 8px; font-size: 11px; color: var(--text-3); text-align: center; }
.credits .hint { margin: 0; }

/* ── AUTH ───────────────────────────────────────────────────── */
.auth { position: relative; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px var(--gutter); overflow: hidden; }
.auth-card { position: relative; z-index: 1; width: min(100%, 400px); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; animation: rise .6s var(--ease) both; }
.auth-card .logo { filter: drop-shadow(0 14px 30px rgba(255, 79, 184, .45)); margin-bottom: 10px; }
.auth-title { font-size: clamp(48px, 15vw, 96px); white-space: nowrap; }
.auth-card > .muted { margin: 0; max-width: 34ch; }
.auth-card > .by-core { align-self: center; margin: 6px 0 2px; }
.auth .form { width: 100%; gap: 12px; margin-top: 4px; }
.btn.google { width: 100%; margin-top: 18px; background: #fff; color: #1f1f1f; border-color: transparent; box-shadow: var(--shadow-s); }
[data-theme="dark"] .btn.google { background: #f7f5fb; }
.or-line { width: 100%; margin: 10px 0 6px; }
.auth-links { display: flex; justify-content: space-between; width: 100%; }
.auth-art { position: absolute; inset: 0; pointer-events: none; }
.aa-ring { position: absolute; border-radius: 50%; border: 1.5px solid; }
.aa-ring.r1 { width: 560px; height: 560px; right: -260px; top: -220px; border-color: color-mix(in srgb, var(--violet) 45%, transparent); border-style: dashed; animation: spin 90s linear infinite; }
.aa-ring.r2 { width: 360px; height: 360px; right: -140px; top: -120px; border-color: color-mix(in srgb, var(--cyan) 45%, transparent); }
.aa-ring.r3 { width: 300px; height: 300px; left: -150px; bottom: -120px; border-color: color-mix(in srgb, var(--pink) 45%, transparent); border-style: dashed; animation: spin 70s linear infinite reverse; }

/* -- SaaS: onboarding, planes, pagos, admin e ideas ----------- */
.dot-badge { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px var(--surface); }
.top-actions .icon-btn { position: relative; }

.onboarding { min-height: 100dvh; padding: 18px 16px 48px; max-width: 760px; margin: 0 auto; }
.ob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.ob-progress { display: flex; gap: 6px; margin-bottom: 18px; }
.ob-progress i { height: 4px; flex: 1; border-radius: 4px; background: var(--surface-3); transition: background .3s; }
.ob-progress i.on { background: var(--accent); }
.ob-card { padding: 22px 20px; }
.ob-card h1 { margin: 6px 0 8px; }
.ob-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.ob-career { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; text-align: left; color: var(--text); }
.ob-career:hover, .ob-career.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.ob-career b { font-size: 14px; }
.ob-career small { font-size: 11px; color: var(--text-3); line-height: 1.3; }
.ob-emoji { font-size: 20px; }
.ob-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.ob-actions .btn { flex: 1; }
.ob-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; margin: 16px 0; border: 1.5px dashed var(--surface-3); border-radius: 18px; background: var(--surface-2); cursor: pointer; text-align: center; }
.ob-drop.busy { opacity: .7; }
.ob-drop b { font-size: 14px; }
.ob-preview { margin-top: 14px; }
.ob-classes { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ob-classes li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.ob-classes li b { flex: 1; font-size: 13px; }
.ob-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.ob-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.ob-list .icon { color: var(--accent); flex: none; }
.ob-install { display: grid; gap: 10px; margin: 14px 0; }
.ob-install > div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.ob-install b { display: block; font-size: 13px; }
.ob-install small { display: block; font-size: 12px; margin-top: 2px; }

.plan-view, .pay-view, .admin-view, .ideas-view { max-width: 860px; margin: 0 auto; padding-bottom: 32px; }
.plan-current { padding: 20px; }
.plan-current-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.quota-ring { flex: none; width: 78px; height: 78px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-3) 0); position: relative; }
.quota-ring::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.quota-ring b, .quota-ring small, .quota-ring span { position: relative; z-index: 1; }
.quota-ring b { font-size: 18px; line-height: 1; }
.quota-ring small { font-size: 11px; color: var(--text-3); }
.quota-ring span { font-size: 9px; color: var(--text-3); }
.quota-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 12px 0; }
.quota-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.price-card { padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.price-card.featured { border: 1px solid var(--accent); box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 18%, transparent); }
.price-card h3 small { font-size: 12px; color: var(--text-3); }
.badge-pop { position: absolute; top: -10px; right: 12px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; }
.plan-list { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text-2); }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list li.off { opacity: .45; text-decoration: line-through; }
.plan-check { color: var(--ok); font-weight: 800; }
.price-card .btn { margin-top: auto; }
.plan-ref { padding: 18px; }
.ref-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.ref-row code { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); letter-spacing: .12em; }

.pay-summary { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pay-how { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.pay-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pay-steps li { display: flex; gap: 10px; align-items: flex-start; }
.pay-steps > li > .mono { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.pay-steps b, .pay-steps small { display: block; }
.pay-steps b { font-size: 13px; }
.pay-steps small { font-size: 12px; color: var(--text-3); }
.pay-order { padding: 18px; }
.pay-order-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pay-amount { display: flex; align-items: baseline; gap: 8px; padding: 12px 0; }
.pay-amount b { font-size: 34px; letter-spacing: -.02em; }
.pay-amount span { color: var(--text-3); }
.pay-target { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; flex-wrap: wrap; }
.pay-qr { width: 150px; height: 150px; object-fit: contain; border-radius: 14px; background: #fff; padding: 8px; }
.pay-data { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.pay-data li { display: flex; justify-content: space-between; gap: 16px; }
.pay-data span { color: var(--text-3); }
.pay-proof { border-top: 1px solid var(--surface-3); padding-top: 14px; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.pay-history { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.pay-history li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); }
.pay-history small { display: block; font-size: 11px; }
.pay-ok { text-align: center; padding: 16px 0; }
.pay-ok h3 { color: var(--ok); margin-bottom: 6px; }
.status-pill { flex: none; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px; background: var(--surface-3); color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.status-pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status-pill.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.status-pill.warn { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.status-pill.info { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.admin-stats .card { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-stats b { font-size: 20px; }
.admin-pay, .admin-user { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--surface-3); flex-wrap: wrap; }
.admin-pay:last-child, .admin-user:last-child { border-bottom: 0; }
.admin-pay small, .admin-user small { display: block; font-size: 11px; }
.admin-pay-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.feedback-view { max-width: 640px; margin: 0 auto; }
.feedback-ok { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface-2)); margin-bottom: 12px; }
.ideas-list { display: flex; flex-direction: column; gap: 10px; }
.idea { display: flex; gap: 12px; padding: 16px; }
.idea-vote { flex: none; width: 46px; height: 54px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); }
.idea-vote.on { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); color: var(--accent); }
.idea-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.idea h3 { font-size: 15px; margin-bottom: 4px; }
.idea p { font-size: 13px; }
.idea-note { margin-top: 6px; color: var(--accent); font-size: 12px; }
.status-pill.nueva { background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); }
.status-pill.planeada { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }
.status-pill.construccion { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }
.status-pill.publicada { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.status-pill.descartada { opacity: .55; }

@media (max-width: 640px) {
  .ob-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .pay-summary { flex-direction: column; align-items: flex-start; }
  .plan-current-row { flex-direction: column; }
  .quota-ring { align-self: flex-end; }
  /* Dos botones con texto largo no caben lado a lado en un iPhone. */
  .ob-actions { flex-direction: column-reverse; gap: 8px; }
  .ob-actions .btn { width: 100%; }
}

@media (max-width: 430px) {
  .topbar { gap: 6px; }
  .brand-name { font-size: 15px; }
  .top-actions .icon-btn { width: 36px; height: 36px; }
}

.admin-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.admin-scroll { max-height: 340px; overflow: auto; margin-top: 8px; }
.admin-scroll::-webkit-scrollbar { width: 6px; }
.admin-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
.admin-idea { padding: 10px 0; border-bottom: 1px solid var(--surface-3); }
.admin-idea:last-child { border-bottom: 0; }
.admin-idea-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.admin-idea-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.admin-idea-actions .input { flex: 1; min-width: 130px; }
.admin-idea-actions select.input { flex: 0 0 140px; }
