/* ═══ componentes: shell · botones · inputs · chips · sheets · filas ═══ */

/* ── topbar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) max(var(--gutter), calc(50% - var(--max) / 2 + var(--gutter))) 10px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.brand-name { font: 800 17px var(--f-display); letter-spacing: -.02em; }
.brand-name b { color: var(--pink); }
.top-actions { margin-left: auto; display: flex; gap: 2px; }
.net-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; padding: 4px 9px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.net-pill.off { color: var(--orange); }
.spin-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); color: var(--cyan); animation: pulse 1.2s infinite; }

/* ── dock inferior + FAB ────────────────────────────────────── */
.dock {
  position: fixed; z-index: 40; left: 0; right: 0; margin: 0 auto;
  bottom: calc(var(--safe-b) + 12px);
  width: min(calc(100% - 24px), 480px); height: var(--dock-h);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px;
  border-radius: 24px; background: var(--glass);
  backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
[data-kb] .dock, [data-kb] .fab { display: none; }   /* teclado abierto: el dock robaría ~80 px de pantalla */
.dock-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 18px; color: var(--text-3); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  transition: color .2s, background .25s var(--ease), transform .15s;
}
.dock-item:active { transform: scale(.92); }
.dock-item.on { color: var(--text); background: var(--surface-3); }
.dock-item.on .icon { color: var(--accent); }
[data-theme="light"] .dock-item.on { background: var(--surface-3); }

.fab {
  position: fixed; z-index: 41;
  right: max(16px, calc(50% - var(--max) / 2 + 16px));
  bottom: calc(var(--safe-b) + var(--dock-h) + 26px);
  width: 60px; height: 60px; border-radius: 20px;
  display: grid; place-items: center; color: #fff;
  background: var(--grad);
  box-shadow: 0 14px 34px -10px rgba(255, 79, 184, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s var(--spring);
}
.fab:active { transform: scale(.9) rotate(90deg); }

/* ── botones ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 26px -12px var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.big { min-height: 54px; font-size: 16px; width: 100%; }
.btn.icon-only { width: 46px; padding: 0; flex: none; }
.btn.sm.icon-only { width: 36px; }
.btn.ai {
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad) border-box;
  border: 1.5px solid transparent;
}
.btn.ai .icon { color: var(--pink); }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-grid; place-items: center; border-radius: 12px;
  color: var(--text-2); transition: background .2s, color .2s;
}
.icon-btn:hover, .icon-btn.on { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.ai-ring {
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  border: 1.5px solid transparent; color: var(--text);
}
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; font-weight: 500; padding: 6px 2px; }
.link-btn:hover { color: var(--text); }

/* Endoso Core Incentive. Un solo punto lima por pieza. */
.by-core {
  display: inline-flex; align-items: center; gap: .4em;
  font: 500 10px/1.2 var(--f-mono); letter-spacing: .04em;
  color: var(--text-3); white-space: nowrap;
}
.by-core b { color: var(--text-2); font-weight: 600; letter-spacing: .01em; }
.by-core-dot {
  width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: var(--ci-signal);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ci-signal) 16%, transparent);
}
.by-core.center { justify-content: center; }

.spinner-wrap { display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }

/* ── inputs ─────────────────────────────────────────────────── */
.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border-radius: var(--r-s); background: var(--surface-2); border: 1px solid var(--line);
  outline: none; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.input:disabled { opacity: .45; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.45; }
.title-input {
  font: 700 23px/1.2 var(--f-display); letter-spacing: -.02em;
  background: transparent; border: 0; border-bottom: 1.5px dashed var(--line-2); border-radius: 0; padding: 8px 0;
}
.title-input:focus { box-shadow: none; border-bottom: 1.5px solid var(--accent); }
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 8px; font: 600 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.field-label b { color: var(--text-2); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--text-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.inline-add { display: flex; gap: 8px; }
.key-row { display: flex; gap: 6px; align-items: center; }
.input-icon { position: relative; width: 100%; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 44px; }

/* toggle */
.toggle { position: relative; width: 52px; height: 32px; flex: none; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .25s; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text-2); transition: transform .3s var(--spring), background .2s; }
.toggle.on { background: var(--accent); border-color: transparent; }
.toggle.on i { transform: translateX(20px); background: #fff; }
.switch-row { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; }

/* segmented */
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); }
.segmented button {
  flex: 1; min-height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-2); font-weight: 600; font-size: 13.5px; transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-s); }
[data-theme="light"] .segmented button.on { background: var(--text); color: var(--bg); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll {
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter);
}
.chips.scroll::-webkit-scrollbar { display: none; }
.view .chips.scroll { margin-top: 14px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background .18s var(--ease), color .18s, border-color .18s, transform .15s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.tinted.on { background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--text); border-color: var(--c); }
.chip-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--c); transform: rotate(45deg); }

/* swatches */
.swatches-container { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 12px; background: var(--c); transition: transform .25s var(--spring), box-shadow .2s; }
.swatch.on { transform: scale(1.08) rotate(-4deg); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.custom-swatch {
  position: relative;
  background: conic-gradient(from 0deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  border: 2px solid var(--surface);
  display: grid; place-items: center;
}
.custom-swatch.on { background: var(--c) !important; }
.swatch-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cw-toggle-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px dashed var(--line-2); }
.cw-toggle-btn.on { background: var(--surface-3); color: var(--accent); border-style: solid; border-color: var(--accent); }

/* circulo cromatico interactivo */
.color-wheel-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 16px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  animation: rise .25s var(--ease) both; width: 100%; max-width: 320px;
}
.color-wheel-wrap {
  position: relative; width: 180px; height: 180px;
  display: grid; place-items: center;
  touch-action: none; user-select: none;
}
/* el fondo (tono + saturación + velo de luz) lo pone ColorWheelPicker inline */
.color-wheel {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .2);
  cursor: crosshair; touch-action: none;
}
.cw-handle {
  position: absolute; width: 22px; height: 22px;
  margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.cw-controls { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.cw-slider-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.cw-slider {
  flex: 1; -webkit-appearance: none; appearance: none; height: 12px; border-radius: 6px;
  background: linear-gradient(to right, #000 0%, var(--ch-hue, #8b5cf6) 50%, #fff 100%);
  outline: none; cursor: pointer;
}
.cw-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #ffffff; border: 2px solid var(--line-2); box-shadow: var(--shadow-s); cursor: pointer;
}
.cw-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #ffffff; border: 2px solid var(--line-2); box-shadow: var(--shadow-s); cursor: pointer;
}
.cw-hex-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.cw-preview-chip {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 6px 12px; border-radius: 10px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.cw-picker-btn { position: relative; overflow: hidden; }
.cw-native-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.cw-photo { display: flex; flex-direction: column; gap: 6px; }
.cw-photo-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* contraste WCAG: "Aa" sobre el color con texto blanco / negro */
.contrast-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.ci { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ci-sample { display: grid; place-items: center; height: 44px; border-radius: 12px; font: 700 20px var(--f-display); box-shadow: inset 0 0 0 1px var(--line-2); }
.ci-cap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.ci-lv { font: 600 10px var(--f-mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }
.ci-lv.ok { color: var(--ok); }
.ci-lv.mid { color: var(--orange); }
.ci-lv.bad { color: var(--bad); }
.ci small { font-size: 11px; }

/* hoja "Usar color" */
.use-color-hero { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 18px; box-shadow: var(--shadow-s); }
.use-color-hero .mono { font-size: 11px; opacity: .85; letter-spacing: .08em; }
.use-color-hero b { font: 700 22px var(--f-display); }
.use-subj { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-align: left; }
.use-subj i { width: 16px; height: 16px; border-radius: 5px; background: var(--c); flex: none; }
.use-subj .icon { color: var(--text-3); }


/* checkbox */
.check {
  flex: none; width: 26px; height: 26px; border-radius: 9px;
  display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--c, var(--accent)) 75%, var(--text-3));
  transition: background .2s, border-color .2s, transform .3s var(--spring);
}
.check svg { width: 18px; height: 18px; fill: none; stroke: #0c0a14; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--ease) .05s; }
.check.on { background: var(--c, var(--accent)); border-color: var(--c, var(--accent)); transform: scale(1.06); }
.check.on svg { stroke-dashoffset: 0; }

.confetti { position: fixed; z-index: 100; pointer-events: none; width: 0; height: 0; }
.confetti i { position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 2px; animation: confetti .75s cubic-bezier(.1, .7, .3, 1) forwards; }

/* progress */
.progress { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 5px; background: var(--grad); transition: width .4s var(--ease); }

/* ── cards y secciones ──────────────────────────────────────── */
.card {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; box-shadow: var(--shadow-s);
}
.section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.section-num { font: 600 10.5px var(--f-mono); color: var(--accent); border: 1px solid currentColor; border-radius: 6px; padding: 1px 5px; }
.section-title { margin: 0; font: 700 18px var(--f-display); letter-spacing: -.02em; }
.section-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.section-head.danger .section-title { color: var(--bad); }
/* header editorial: [eyebrow ··· acciones] / TÍTULO a todo el ancho */
.view-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
  min-height: 40px; padding: 18px 0 16px;
}
.view-head > div:first-child { display: contents; }
.view-head .eyebrow { grid-column: 1; grid-row: 1; margin: 0; }
.view-head .head-actions { grid-column: 2; grid-row: 1; }
.view-head .display { grid-column: 1 / -1; grid-row: 2; margin-top: 8px; font-size: clamp(36px, 10vw, 62px); }
.month-title { white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 6px; flex: none; min-height: 40px; }
.zero-state { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r-m); border: 1.5px dashed var(--line-2); color: var(--text-2); font-size: 14px; }
.zero-state .icon { color: var(--accent); flex: none; }
.badge { display: inline-block; font: 600 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px; color: var(--text-2); font-size: 14px; white-space: pre-wrap; margin: 0; }

/* empty state con curva bézier */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; text-align: center; }
.empty-art { width: 160px; height: 92px; margin-bottom: 10px; overflow: visible; }
.ea-curve { fill: none; stroke: var(--pink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 300; animation: draw 1.6s var(--ease) both; }
.ea-handle { stroke: var(--text-3); stroke-width: 1.2; }
.ea-knob, .ea-node { fill: var(--bg); stroke: var(--cyan); stroke-width: 2; }
.empty h3 { margin: 0; font: 700 20px var(--f-display); letter-spacing: -.02em; }
.empty p { margin: 0 0 12px; color: var(--text-2); max-width: 32ch; }

/* ── filas de ítems ─────────────────────────────────────────── */
.task-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 13px 14px 13px 16px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden; cursor: pointer;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
  transition: transform .15s var(--ease), border-color .2s;
}
.task-row::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.task-row:active { transform: scale(.985); }
.task-row:hover { border-color: var(--line-2); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.task-title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; font-size: 12px; color: var(--text-3); }
.is-done .task-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--c); text-decoration-thickness: 2px; }
.is-done { opacity: .75; }
.kind-badge { font: 600 9.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--text); }
.due, .sub-count { display: inline-flex; align-items: center; gap: 4px; }
.due.late { color: var(--bad); font-weight: 600; }
.prio { color: var(--orange); flex: none; }
.subj-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.subj-tag i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); transform: rotate(45deg); flex: none; }

/* ticket de examen */
.ticket {
  position: relative; flex: none; width: min(300px, 82vw); min-height: 108px;
  display: flex; text-align: left; scroll-snap-align: start;
  border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; box-shadow: var(--shadow-s);
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms);
  transition: transform .15s var(--ease);
}
.ticket:active { transform: scale(.98); }
.tickets-v .ticket { width: 100%; }
.ticket::before, .ticket::after {
  content: ''; position: absolute; left: 92px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line); transform: translateX(-50%); z-index: 1;
}
.ticket::before { top: -10px; }
.ticket::after { bottom: -10px; }
.ticket-stub {
  flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--c); color: var(--ink);
  border-right: 2px dashed color-mix(in srgb, var(--ink) 30%, transparent);
}
.ticket-stub b { font: 800 40px/1 var(--f-display); letter-spacing: -.05em; }
.ticket-stub small { font: 600 10px var(--f-mono); letter-spacing: .16em; margin-top: 5px; }
.ticket-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; }
.ticket-body .eyebrow { margin: 0; color: var(--text-2); }
.ticket-title { font: 700 17px/1.2 var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.ticket-meta { margin-top: auto; padding-top: 6px; font-size: 11.5px; color: var(--text-2); }
.ticket-weight { position: absolute; top: 12px; right: 12px; font-size: 11px; color: var(--text-3); }
.ticket.soon { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 14px 30px -14px var(--c); }

/* clase (timeline) */
.timeline { display: flex; flex-direction: column; gap: 6px; }
.class-row {
  display: grid; grid-template-columns: 50px 4px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); cursor: pointer;
  transition: transform .15s;
}
.class-row:active { transform: scale(.985); }
.cr-time { display: flex; flex-direction: column; font-size: 11.5px; line-height: 1.35; }
.cr-time b { font-size: 14px; color: var(--text); }
.cr-time small { color: var(--text-3); }
.cr-bar { position: relative; align-self: stretch; min-height: 34px; border-radius: 4px; background: color-mix(in srgb, var(--c) 28%, transparent); overflow: hidden; }
.cr-bar i { position: absolute; left: 0; right: 0; top: 0; border-radius: 4px; background: var(--c); transition: height .6s var(--ease); }
.cr-main { display: flex; flex-direction: column; min-width: 0; }
.cr-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-main small { font-size: 12px; color: var(--text-3); }
.class-row.past { opacity: .5; }
.class-row.live { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 12px 30px -14px var(--c); }
.live-pill { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; padding: 3px 7px; border-radius: 5px; background: var(--c); color: #120d20; }
.gap-row { display: flex; align-items: center; gap: 10px; padding: 2px 14px; font-size: 11px; color: var(--text-3); }
.gap-row span { width: 50px; border-top: 1.5px dashed var(--line-2); }

/* evento */
.event-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); cursor: pointer;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 38%, transparent);
}
.ev-time { min-width: 78px; font-size: 11px; font-weight: 600; color: color-mix(in srgb, var(--c) 65%, var(--text)); }
.event-row b, .event-row small { display: block; }
.event-row small { font-size: 12px; }

/* nota / examen pasado */
.grade-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.gr-dot { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--c); transform: rotate(45deg); }
.grade-row b { display: block; font-weight: 600; }
.grade-row small { font-size: 12px; }
.grade { font: 700 20px var(--f-mono); }
.grade small { font-size: 11px; color: var(--text-3); }

/* recordatorio */
.reminder-row { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.reminder-row.due { border-color: var(--yellow); }
.reminder-row.due > .icon { color: var(--yellow); }
.ghost-btn { text-align: left; color: var(--text); }
.ghost-btn b, .ghost-btn small { display: block; }
.ghost-btn small { color: var(--text-3); font-size: 11.5px; }

/* ── bottom sheet ───────────────────────────────────────────── */
.sheet-layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 4, 14, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .25s both; }
.sheet {
  position: relative; width: min(100%, 560px); max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 28px 28px 0 0; box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, .6);
  animation: sheetIn .4s var(--spring) both; transition: transform .25s var(--ease);
}
.sheet.tall { height: 90dvh; }
.sheet-layer.closing { pointer-events: none; }
.sheet-layer.closing .sheet { animation: sheetOut .22s var(--ease) both; }
.sheet-layer.closing .sheet-backdrop { animation: fadeOut .22s both; }
.sheet-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 20px 12px 8px var(--gutter); touch-action: none; cursor: grab; }
.sheet-grip { position: absolute; top: 8px; left: 50%; width: 42px; height: 4px; border-radius: 4px; background: var(--line-2); transform: translateX(-50%); }
.sheet-title { flex: 1; margin: 0; font: 700 20px var(--f-display); letter-spacing: -.02em; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px var(--gutter) calc(var(--safe-b) + 18px); }
.sheet-actions {
  position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px;
  margin-top: 4px; padding-top: 14px;
  background: linear-gradient(to bottom, transparent, var(--surface) 35%);
}
.confirm p { margin: 0 0 18px; color: var(--text-2); }

/* ── toasts ─────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 90; left: 0; right: 0; margin: 0 auto;
  bottom: calc(var(--safe-b) + var(--dock-h) + 100px);
  width: min(calc(100% - 32px), 440px);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px; border-radius: 16px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); animation: toastIn .35s var(--spring) both;
}
.toast.error { background: var(--bad); color: #fff; }
.toast-act { margin-left: auto; flex: none; font: 700 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--violet); padding: 4px 2px; }
.toast.error .toast-act { color: #fff; }
