/* ============================================================
   PLENO — RUTINAS
   Estilos del módulo de rutinas (secuencias de pasos con cronómetro).
   Archivo propio en vez de sumar a components.css: el módulo es autocontenido
   y así es más fácil de ubicar. El build lo versiona con ?v=BUILD igual que al
   resto, así que un cambio de estilos llega siempre (los CSS se sirven con
   cache immutable de un año y sin esa versión quedarían congelados).
   ============================================================ */

.pl-rut-list { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Tarjeta de rutina ---------- */
.pl-rut-card {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--pl-surface); border: 1px solid var(--pl-border);
  border-radius: 18px; padding: 14px 14px 14px 16px;
  transition: border-color .16s var(--pl-ease), transform .16s var(--pl-ease);
}
.pl-rut-card:hover { border-color: rgba(207,174,99,.42); transform: translateY(-1px); }
.pl-rut-card-main { flex: 1; min-width: 0; }
.pl-rut-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.pl-rut-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--pl-font); font-size: 11.5px; font-weight: 600;
  color: var(--pl-text-mute); background: var(--pl-surface-2);
  border-radius: 999px; padding: 3px 9px;
}
.pl-rut-days { display: inline-flex; gap: 3px; }
.pl-rut-days span {
  font-family: var(--pl-font); font-size: 10.5px; font-weight: 700;
  color: var(--pl-text-mute); opacity: .38; letter-spacing: .02em;
}
.pl-rut-days span.is-on { color: var(--pl-accent-400); opacity: 1; }
.pl-rut-card-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pl-rut-emoji { font-size: 19px; line-height: 1; flex-shrink: 0; }
.pl-rut-name {
  font-family: var(--pl-font); font-size: 16px; font-weight: 700; color: var(--pl-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pl-rut-card-sub { font-family: var(--pl-font); font-size: 12.5px; color: var(--pl-text-mute); margin-top: 4px; }

.pl-rut-play {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--pl-surface-2); border: 1px solid var(--pl-border);
  color: var(--pl-text-soft); transition: all .16s var(--pl-ease);
}
.pl-rut-play:hover { background: var(--pl-accent-400); border-color: var(--pl-accent-400); color: #fff; }
.pl-rut-play.is-live { background: rgba(207,174,99,.12); border-color: rgba(207,174,99,.4); }

/* ---------- Banda de rutina en curso ---------- */
.pl-rut-live {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(207,174,99,.08); border: 1px solid rgba(207,174,99,.25);
}
.pl-rut-live-title { font-family: var(--pl-font); font-size: 13.5px; font-weight: 700; color: #CFAE63; }
.pl-rut-live-sub {
  font-family: var(--pl-font); font-size: 11.5px; color: var(--pl-text-mute); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Lista de pasos ---------- */
.pl-rut-steps { display: flex; flex-direction: column; gap: 7px; }
.pl-rut-step {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: 14px;
  background: var(--pl-surface-2); border: 1px solid transparent;
  transition: all .16s var(--pl-ease);
}
.pl-rut-step.is-current { background: rgba(207,174,99,.10); border-color: rgba(207,174,99,.35); }
.pl-rut-step.is-done { opacity: .5; }
.pl-rut-step.is-done .pl-rut-step-name { text-decoration: line-through; }
.pl-rut-step-n {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--pl-font); font-size: 11px; font-weight: 700;
  background: var(--pl-surface); color: var(--pl-text-mute);
}
.pl-rut-step.is-current .pl-rut-step-n { background: var(--pl-accent-400); color: #fff; }
.pl-rut-step.is-done .pl-rut-step-n { background: var(--pl-success-400); color: #fff; }
.pl-rut-step-emoji { font-size: 16px; line-height: 1; flex-shrink: 0; }
.pl-rut-step-name {
  flex: 1; min-width: 0; font-family: var(--pl-font); font-size: 14.5px; font-weight: 600; color: var(--pl-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pl-rut-step-min { font-family: var(--pl-font); font-size: 12.5px; color: var(--pl-text-mute); flex-shrink: 0; }

/* ---------- Detalle ---------- */
.pl-rut-det-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 4px; }
.pl-rut-det-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pl-rut-emoji-big { font-size: 30px; line-height: 1; flex-shrink: 0; }
.pl-rut-det-name {
  font-family: var(--pl-font); font-size: 25px; font-weight: 700; letter-spacing: -.01em;
  color: var(--pl-text); margin: 0; min-width: 0;
}
.pl-rut-det-sub { font-family: var(--pl-font); font-size: 13px; color: var(--pl-text-mute); margin-top: 6px; }
.pl-rut-habit-link {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 10px 13px; border-radius: 13px;
  background: rgba(207,174,99,.07); border: 1px solid rgba(207,174,99,.2);
  font-family: var(--pl-font); font-size: 12.5px; color: var(--pl-text-soft);
}

/* ---------- CTA fija (móvil) ---------- */
.pl-rut-cta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px 20px;
  background: linear-gradient(to top, var(--pl-bg) 62%, transparent);
}
.pl-rut-start {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 11px;
  padding: 15px 20px; border-radius: 20px; border: none; cursor: pointer;
  font-family: var(--pl-font); font-size: 16px; font-weight: 700; color: var(--pl-primary-900);
  background: linear-gradient(135deg, #E6C078 0%, #C4965A 100%);
  box-shadow: 0 8px 22px rgba(196,150,90,.38);
}
.pl-rut-start-ico {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   CRONÓMETRO EN EJECUCIÓN
   Ritmo vertical por grupos: contexto → paso → tiempo → controles →
   acción → siguiente → pie. El aire entre bloques es lo que separa
   "pantalla apilada" de "pantalla compuesta".
   ============================================================ */
.pl-rut-run {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 420px; margin: 0 auto;
  --rut-txt: var(--pl-text);
  --rut-mute: var(--pl-text-mute);
  --rut-soft: var(--pl-text-soft);
  --rut-line: var(--pl-border);
  --rut-surf: var(--pl-surface-2);
}
.pl-rut-run.is-dark {
  --rut-txt: var(--pl-foco-text);
  --rut-mute: var(--pl-foco-mute);
  --rut-soft: var(--pl-foco-soft);
  --rut-line: rgba(255,255,255,.12);
  --rut-surf: rgba(255,255,255,.06);
}

/* --- Contexto + progreso de la rutina --- */
.pl-rut-run-top { width: 100%; text-align: center; }
.pl-rut-run-ctx {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--pl-font); font-size: 12px; font-weight: 500;
  color: var(--rut-mute); letter-spacing: .04em; text-transform: uppercase;
}
.pl-rut-run-rut {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--rut-soft); font-weight: 600;
}
.pl-rut-run-sep { opacity: .5; }
.pl-rut-prog { display: flex; gap: 4px; width: 100%; margin-top: 12px; }
.pl-rut-prog-seg {
  flex: 1; height: 3px; border-radius: 2px; background: var(--rut-line);
  transition: background .3s var(--pl-ease);
}
.pl-rut-prog-seg.is-done { background: rgba(207,174,99,.55); }
.pl-rut-prog-seg.is-now { background: #CFAE63; box-shadow: 0 0 8px rgba(207,174,99,.5); }

/* --- Paso actual: lo que estoy haciendo --- */
.pl-rut-run-step {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  margin-top: 30px; padding: 0 8px; max-width: 100%;
}
.pl-rut-run-emoji { font-size: 30px; line-height: 1; flex-shrink: 0; }
.pl-rut-run-name {
  font-family: var(--pl-font); font-size: 23px; font-weight: 700;
  letter-spacing: -.015em; color: var(--rut-txt); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
}

/* --- Anillo: único foco, solo el tiempo adentro --- */
.pl-rut-run-ring { margin-top: 26px; }
.pl-rut-run-time {
  font-family: var(--pl-font); font-size: 52px; font-weight: 700;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  color: var(--rut-txt); line-height: 1;
}
.pl-rut-run-pausado {
  font-family: var(--pl-font); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: #CFAE63; margin-top: 9px;
}

/* --- Ajuste de duración: discreto, fuera del anillo --- */
.pl-rut-run-adj {
  display: flex; align-items: center; gap: 14px; margin-top: 20px;
  font-family: var(--pl-font); font-size: 13px; font-weight: 600; color: var(--rut-mute);
}
.pl-rut-run-adj button {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0; line-height: 1;
  background: transparent; border: 1px solid var(--rut-line); color: var(--rut-soft);
  font-family: var(--pl-font); font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .14s var(--pl-ease);
}
.pl-rut-run-adj button:hover { border-color: #CFAE63; color: #CFAE63; }
.pl-rut-run-adj span { min-width: 52px; text-align: center; }

/* --- Transporte: los tres del mismo peso visual --- */
.pl-rut-run-ctrls {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 10px; margin-top: 28px; width: 100%;
}
.pl-rut-tctrl {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; padding: 0; flex: 1; max-width: 96px;
  font-family: var(--pl-font); -webkit-tap-highlight-color: transparent;
  color: var(--rut-mute); transition: color .14s var(--pl-ease);
}
.pl-rut-tctrl > :first-child {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rut-surf); border: 1px solid var(--rut-line);
  transition: all .16s var(--pl-ease);
}
.pl-rut-tctrl span { font-size: 11.5px; font-weight: 600; }
.pl-rut-tctrl:hover:not(:disabled) { color: var(--rut-soft); }
.pl-rut-tctrl:hover:not(:disabled) > :first-child { border-color: rgba(207,174,99,.5); }
.pl-rut-tctrl:disabled { opacity: .3; cursor: default; }
/* El principal es más grande y con acento dorado, pero NO relleno:
   el único relleno dorado es la acción principal de abajo. */
.pl-rut-tctrl.is-main > :first-child {
  width: 64px; height: 64px;
  border-color: rgba(207,174,99,.45); color: #CFAE63;
  background: rgba(207,174,99,.09);
}
.pl-rut-tctrl.is-main:hover > :first-child { background: rgba(207,174,99,.16); }
.pl-rut-tctrl.is-main span { color: #CFAE63; }

/* --- Acción principal: el único dorado lleno de la pantalla --- */
.pl-rut-done {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 30px; padding: 15px 34px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--pl-font); font-size: 15.5px; font-weight: 700; color: #1A1712;
  background: linear-gradient(135deg, #E6C078 0%, #C4965A 100%);
  box-shadow: 0 10px 26px rgba(196,150,90,.34);
  transition: transform .14s var(--pl-ease), box-shadow .14s var(--pl-ease);
}
.pl-rut-done:hover { transform: translateY(-1px); box-shadow: 0 13px 30px rgba(196,150,90,.42); }
.pl-rut-done:active { transform: translateY(0); }

/* --- Qué viene después --- */
.pl-rut-run-next {
  display: flex; align-items: center; gap: 9px; margin-top: 26px;
  padding: 10px 15px; border-radius: 999px; max-width: 100%;
  background: var(--rut-surf); border: 1px solid var(--rut-line);
  font-family: var(--pl-font); font-size: 12.5px; color: var(--rut-soft);
}
.pl-rut-run-next-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--rut-mute); flex-shrink: 0;
}
.pl-rut-run-next-emoji { font-size: 14px; line-height: 1; flex-shrink: 0; }
.pl-rut-run-next-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pl-rut-run-next-min { color: var(--rut-mute); flex-shrink: 0; }

/* --- Pie: información y salida, separados por una línea --- */
.pl-rut-run-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rut-line);
  font-family: var(--pl-font); font-size: 12.5px; color: var(--rut-mute);
}
.pl-rut-run-foot b { color: var(--rut-soft); font-weight: 700; }
.pl-rut-run-foot button {
  background: none; border: none; cursor: pointer; padding: 4px 2px;
  font-family: var(--pl-font); font-size: 12.5px; font-weight: 600;
  color: var(--rut-mute); text-decoration: underline; text-underline-offset: 3px;
  transition: color .14s var(--pl-ease);
}
.pl-rut-run-foot button:hover { color: var(--pl-alert-500); }

/* ---------- Ícono de la rutina (set de PLENO, no emoji) ---------- */
.pl-rut-ico {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(207,174,99,.11); border: 1px solid rgba(207,174,99,.24);
}
.pl-rut-ico-lg { width: 52px; height: 52px; border-radius: 16px; }

/* ---------- Selector de tipo de rutina ---------- */
.pl-rut-presets { display: flex; flex-direction: column; gap: 9px; }
.pl-rut-preset {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 12px; row-gap: 2px; align-items: center; text-align: left;
  padding: 13px 14px; border-radius: 16px; cursor: pointer;
  background: var(--pl-surface-2); border: 1px solid var(--pl-border);
  transition: all .16s var(--pl-ease);
}
.pl-rut-preset:hover { border-color: var(--pl-accent-400); background: rgba(207,174,99,.07); }
.pl-rut-preset-ico {
  grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(207,174,99,.13); border: 1px solid rgba(207,174,99,.26);
}
.pl-rut-preset-lbl { font-family: var(--pl-font); font-size: 15px; font-weight: 700; color: var(--pl-text); }
.pl-rut-preset-desc { font-family: var(--pl-font); font-size: 12.5px; color: var(--pl-text-mute); }

/* ---------- Selector de ícono ---------- */
.pl-rut-icon-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pl-rut-icon-pick {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer; padding: 0;
  background: var(--pl-surface-2); border: 1px solid transparent; color: var(--pl-text-soft);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .14s var(--pl-ease);
}
.pl-rut-icon-pick:hover { border-color: var(--pl-border); }
.pl-rut-icon-pick.is-on {
  border-color: var(--pl-accent-400); background: rgba(207,174,99,.14); color: var(--pl-accent-400);
}

/* ---------- Checkbox de vínculo con hábito ---------- */
.pl-rut-check {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; cursor: pointer;
  font-family: var(--pl-font); font-size: 13px; color: var(--pl-text-soft); line-height: 1.45;
}
.pl-rut-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--pl-accent-400); cursor: pointer; flex-shrink: 0; }

/* ---------- Paleta de emojis del paso ---------- */
.pl-rut-emoji-pop {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px;
  padding: 10px; border-radius: 13px;
  background: var(--pl-surface); border: 1px solid var(--pl-border);
}

/* ---------- Editor ---------- */
.pl-rut-emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-rut-emoji-pick {
  width: 36px; height: 36px; border-radius: 11px; cursor: pointer; font-size: 17px; line-height: 1;
  background: var(--pl-surface-2); border: 1px solid transparent; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.pl-rut-emoji-pick.is-on { border-color: var(--pl-accent-400); background: rgba(207,174,99,.14); }
.pl-rut-day {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  font-family: var(--pl-font); font-size: 13px; font-weight: 700;
  background: var(--pl-surface-2); border: 1px solid var(--pl-border); color: var(--pl-text-mute);
}
.pl-rut-day.is-on { background: var(--pl-primary-600); border-color: var(--pl-primary-600); color: #fff; }

.pl-rut-edit-step {
  display: flex; align-items: center; gap: 7px;
  padding: 8px; border-radius: 14px; background: var(--pl-surface-2);
}
.pl-rut-edit-order { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }
.pl-rut-edit-order button {
  width: 22px; height: 17px; border-radius: 5px; cursor: pointer; padding: 0;
  background: var(--pl-surface); border: 1px solid var(--pl-border); color: var(--pl-text-mute);
  display: flex; align-items: center; justify-content: center;
}
.pl-rut-edit-order button:disabled { opacity: .3; cursor: default; }
.pl-rut-edit-emoji {
  width: 42px; height: 40px; flex-shrink: 0; font-size: 18px; line-height: 1; padding: 0; cursor: pointer;
  border-radius: 12px; border: 1px dashed var(--pl-border);
  background: var(--pl-surface); color: var(--pl-text);
  display: inline-flex; align-items: center; justify-content: center;
}
.pl-rut-edit-emoji:hover { border-color: var(--pl-accent-400); border-style: solid; }
.pl-rut-edit-name {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 11px;
  border: 1px solid var(--pl-border); background: var(--pl-surface);
  color: var(--pl-text); font-family: var(--pl-font); font-size: 14px;
}
.pl-rut-edit-min { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.pl-rut-edit-min input {
  width: 52px; padding: 9px 6px; text-align: center; border-radius: 11px;
  border: 1px solid var(--pl-border); background: var(--pl-surface);
  color: var(--pl-text); font-family: var(--pl-font); font-size: 14px;
}
.pl-rut-edit-min span { font-family: var(--pl-font); font-size: 12px; color: var(--pl-text-mute); }
.pl-rut-edit-del {
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer; flex-shrink: 0; padding: 0;
  background: transparent; border: none; color: var(--pl-text-mute);
  display: flex; align-items: center; justify-content: center;
}
.pl-rut-edit-del:hover { background: rgba(200,80,70,.1); color: var(--pl-alert-500); }
.pl-rut-add-step {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  margin-top: 9px; padding: 11px; border-radius: 13px; cursor: pointer;
  background: transparent; border: 1.5px dashed var(--pl-border); color: var(--pl-text-soft);
  font-family: var(--pl-font); font-size: 13.5px; font-weight: 600;
}
.pl-rut-add-step:hover { border-color: var(--pl-accent-400); color: var(--pl-accent-400); }

/* ---------- ESCRITORIO: layout propio, no el móvil estirado ---------- */
.pl-rut-desk { max-width: 1080px; margin: 0 auto; padding: 24px 28px 48px; }
.pl-rut-desk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pl-rut-desk-title {
  font-family: var(--pl-font); font-size: 30px; font-weight: 700;
  letter-spacing: -.01em; color: var(--pl-text); margin: 2px 0 0;
}
.pl-rut-desk-live {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--pl-font);
  font-size: 12.5px; font-weight: 600; color: #B08544;
  background: rgba(207,174,99,.10); border: 1px solid rgba(207,174,99,.28);
  border-radius: 999px; padding: 7px 14px;
}
.pl-rut-desk-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.pl-rut-desk-main { min-width: 0; }
.pl-rut-desk-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 900px) { .pl-rut-desk-grid { grid-template-columns: 1fr; } }
