/* ============================================================
   PLENO — Component styles (usa tokens.css)
   ============================================================ */
* { box-sizing: border-box; }

button {
  color: inherit;
  font-family: inherit;
}

.pl-root {
  font-family: var(--pl-font);
  color: var(--pl-text);
  background: var(--pl-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- BUTTONS ---------- */
.plb {
  font-family: var(--pl-font);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--pl-r-button);
  font-size: 15px; font-weight: 600; line-height: 1;
  border: 1.5px solid transparent; cursor: pointer;
  padding: 0 22px; height: 50px;
  transition: transform .14s var(--pl-ease), background .18s var(--pl-ease), box-shadow .18s var(--pl-ease), opacity .18s;
  user-select: none; white-space: nowrap; position: relative; overflow: hidden;
}
.plb:active { transform: scale(0.97); }
.plb:disabled { opacity: .5; cursor: not-allowed; }
.plb-block { width: 100%; }
.plb-sm { height: 40px; font-size: 14px; padding: 0 16px; }
.plb-lg { height: 56px; font-size: 16px; }

.plb-primary { background: var(--pl-primary-600); color: var(--pl-on-primary); box-shadow: var(--pl-shadow-primary); }
.plb-primary:hover:not(:disabled) { background: var(--pl-primary-500); }
.plb-accent { background: var(--pl-accent-400); color: var(--pl-primary-900); box-shadow: var(--pl-shadow-accent); }
.plb-accent:hover:not(:disabled) { background: var(--pl-accent-300); }
.plb-secondary { background: transparent; color: var(--pl-primary-600); border-color: var(--pl-border); }
.pl-dark .plb-secondary { color: var(--pl-text); }
.plb-secondary:hover:not(:disabled) { background: var(--pl-surface-2); border-color: var(--pl-primary-300); }
.plb-ghost { background: transparent; color: var(--pl-text-soft); padding: 0 12px; }
.plb-ghost:hover:not(:disabled) { background: var(--pl-surface-2); color: var(--pl-text); }
.plb-destructive { background: transparent; color: var(--pl-alert-500); border-color: var(--pl-alert-100); }
.plb-destructive:hover:not(:disabled) { background: var(--pl-alert-50); }

.plb-icon { width: 44px; height: 44px; padding: 0; border-radius: var(--pl-r-full); }

/* loading spinner */
.pl-spin { width: 18px; height: 18px; border-radius: 50%; border: 2.2px solid currentColor; border-top-color: transparent; animation: pl-rot .7s linear infinite; }
@keyframes pl-rot { to { transform: rotate(360deg); } }

/* ---------- INPUTS ---------- */
.pl-field { display: flex; flex-direction: column; gap: 6px; }
.pl-field > label { font-size: 13px; font-weight: 500; color: var(--pl-text-soft); }
.pl-input, .pl-textarea, .pl-select {
  font-family: var(--pl-font); font-size: 15px; color: var(--pl-text);
  background: var(--pl-surface); border: 1.5px solid var(--pl-border);
  border-radius: var(--pl-r-input); padding: 13px 14px; width: 100%;
  transition: border-color .16s, box-shadow .16s; outline: none;
}
.pl-input::placeholder, .pl-textarea::placeholder { color: var(--pl-text-mute); }
.pl-input:focus, .pl-textarea:focus, .pl-select:focus { border-color: var(--pl-accent-400); box-shadow: var(--pl-focus-ring); }
.pl-input.is-error { border-color: var(--pl-alert-500); box-shadow: 0 0 0 4px rgba(216,84,63,0.10); }
.pl-input:disabled { background: var(--pl-surface-2); color: var(--pl-text-mute); cursor: not-allowed; }
.pl-err-msg { font-size: 12px; color: var(--pl-alert-500); display: flex; align-items: center; gap: 5px; }
.pl-textarea { resize: none; min-height: 88px; line-height: 1.5; }
.pl-select { appearance: none; cursor: pointer; background-image: none; }

.pl-amount-wrap { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--pl-border); border-radius: var(--pl-r-input); padding: 10px 16px; background: var(--pl-surface); transition: border-color .16s, box-shadow .16s; }
.pl-amount-wrap.is-focus { border-color: var(--pl-accent-400); box-shadow: var(--pl-focus-ring); }
.pl-amount-cur { font-size: 24px; font-weight: 600; color: var(--pl-text-mute); }
.pl-amount-input { border: none; outline: none; background: transparent; font-family: var(--pl-font); font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--pl-text); width: 100%; padding: 0; }
.pl-amount-input::placeholder { color: var(--pl-gray-300); }

/* ---------- CARDS ---------- */
.pl-card { background: var(--pl-surface); border-radius: var(--pl-r-card); border: 1px solid var(--pl-border); box-shadow: var(--pl-shadow-sm); }
.pl-card-pad { padding: 18px; }
.pl-card-flat { box-shadow: none; }

/* ---------- BADGES / PILLS ---------- */
.pl-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--pl-r-badge); padding: 4px 9px; font-size: 12px; font-weight: 600; line-height: 1.2; }
.pl-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--pl-r-full); padding: 6px 13px; font-size: 13px; font-weight: 500; line-height: 1; border: 1.5px solid var(--pl-border); background: var(--pl-surface); color: var(--pl-text-soft); cursor: pointer; transition: all .15s; white-space: nowrap; }
.pl-pill.is-active { background: var(--pl-primary-600); color: var(--pl-on-primary); border-color: var(--pl-primary-600); }
.pl-pill-cat { color: #fff; border: none; }

.pl-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- BOTTOM NAV ---------- */
/* NOTA: NO usar `padding-bottom: env(safe-area-inset-bottom)` acá. Con el global
   `* { box-sizing: border-box }`, ese padding le RESTA alto al contenido dentro del alto
   fijo de 64px. En teléfonos donde el WebView reporta un inset > 0 (barra de gestos)
   apretaba los íconos hacia arriba, los sacaba del recuadro blanco y empujaba el label
   "Pleno" (marginTop:32) fuera de la barra. El FAB, los docks y el padding de las pantallas
   consumen la altura como `var(--pl-bottomnav-h)` (64px fijos), así que la barra queda en
   bottom:0 con 64px exactos y el contenido la llena completa, igual que antes. */
.pl-bottomnav { position: absolute; left: 0; right: 0; bottom: 0; height: var(--pl-bottomnav-h); background: var(--pl-surface); border-top: 1px solid var(--pl-border); display: flex; align-items: stretch; z-index: 40; }
.pl-navitem { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; color: var(--pl-text-mute); transition: color .16s; position: relative; background: none; border: none; font-family: var(--pl-font); }
.pl-navitem span { font-size: 10px; font-weight: 600; letter-spacing: .01em; }
.pl-navitem.is-active { color: var(--pl-primary-600); }
.pl-navitem.is-active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--pl-primary-600); }

/* ---------- HEADER ---------- */
.pl-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; gap: 12px; }

/* ---------- SEGMENTED TABS ---------- */
.pl-seg { display: flex; background: var(--pl-surface-2); border-radius: var(--pl-r-full); padding: 4px; gap: 4px; }
.pl-seg button { flex: 1; border: none; background: none; font-family: var(--pl-font); font-size: 14px; font-weight: 600; color: var(--pl-text-soft); padding: 9px 8px; border-radius: var(--pl-r-full); cursor: pointer; transition: all .18s var(--pl-ease); }
.pl-seg button.is-active { background: var(--pl-surface); color: var(--pl-primary-600); box-shadow: var(--pl-shadow-sm); }
.pl-dark .pl-seg button.is-active { background: var(--pl-primary-600); color: var(--pl-on-primary); }

/* ---------- PROGRESS DOTS ---------- */
.pl-dots { display: flex; gap: 8px; align-items: center; }
.pl-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--pl-gray-200); transition: all .3s var(--pl-ease); }
.pl-dots i.on { width: 24px; border-radius: 4px; background: var(--pl-primary-600); }
.pl-dots i.done { background: var(--pl-primary-300); }

/* ---------- BOTTOM SHEET ---------- */
.pl-sheet-scrim { position: fixed; inset: 0; background: rgba(20,16,10,.45); z-index: 300; opacity: 0; transition: opacity .28s var(--pl-ease); }
.pl-sheet-scrim.show { opacity: 1; }
.pl-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--pl-bg); border-radius: 24px 24px 0 0; z-index: 301; transform: translateY(100%); transition: transform .34s var(--pl-ease); max-height: 92%; display: flex; flex-direction: column; box-shadow: 0 -8px 40px rgba(20,16,10,.2); }
.pl-sheet.show { transform: translateY(0); }
.pl-sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--pl-gray-300); margin: 10px auto 4px; flex-shrink: 0; }

/* ---------- TOAST ---------- */
.pl-toast { position: absolute; left: 16px; right: 16px; bottom: calc(var(--pl-bottomnav-h) + 14px); background: var(--pl-gray-900); color: #fff; border-radius: 14px; padding: 13px 16px; display: flex; align-items: center; gap: 11px; z-index: 400; box-shadow: var(--pl-shadow-lg); font-size: 14px; font-weight: 500; animation: pl-toast-in .34s var(--pl-ease-spring); }
.pl-dark .pl-toast { background: var(--pl-surface-2); border: 1px solid var(--pl-border); }
@keyframes pl-toast-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pl-toast-exit { animation: pl-toast-out .35s var(--pl-ease) forwards; pointer-events: none; }
@keyframes pl-toast-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }

/* ---------- SKELETON ---------- */
.pl-skel { background: linear-gradient(100deg, var(--pl-surface-2) 30%, var(--pl-gray-100) 50%, var(--pl-surface-2) 70%); background-size: 220% 100%; animation: pl-shimmer 1.3s linear infinite; border-radius: 10px; }
@keyframes pl-shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }

/* ---------- SUCCESS BURST ---------- */
.pl-burst { position: absolute; inset: 0; pointer-events: none; z-index: 90; display: flex; align-items: center; justify-content: center; }
.pl-burst-ring { width: 90px; height: 90px; border-radius: 50%; background: var(--pl-accent-500); display: flex; align-items: center; justify-content: center; color: #fff; animation: pl-pop .5s var(--pl-ease-spring) forwards; box-shadow: 0 8px 30px rgba(196,150,90,.45); }
@keyframes pl-pop { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.pl-confetti { position: absolute; width: 9px; height: 9px; border-radius: 2px; animation: pl-fly .7s var(--pl-ease) forwards; }
@keyframes pl-fly { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* ---------- CHECKBOX / HABIT CHECK ---------- */
.pl-check { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--pl-gray-300); background: var(--pl-surface); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s var(--pl-ease); flex-shrink: 0; color: #fff; }
.pl-check.on { background: var(--pl-success-500); border-color: var(--pl-success-500); }
.pl-check.on svg { animation: pl-check-in .3s var(--pl-ease-spring); }
@keyframes pl-check-in { from { transform: scale(0); } to { transform: scale(1); } }

.pl-daycircle { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }

/* ---------- FAB ---------- */
.pl-fab { position: absolute; right: 16px; bottom: calc(var(--pl-bottomnav-h) + 16px); width: 58px; height: 58px; border-radius: var(--pl-r-full); background: var(--pl-accent-400); color: var(--pl-primary-900); border: none; display: flex; align-items: center; justify-content: center; box-shadow: var(--pl-shadow-accent); cursor: pointer; z-index: 45; transition: transform .16s var(--pl-ease); }
.pl-fab:active { transform: scale(0.92); }

/* scrollbars hidden inside phone */
.pl-scroll::-webkit-scrollbar { width: 0; height: 0; }
.pl-scroll { scrollbar-width: none; -ms-overflow-style: none; }

/* page transition */
.pl-screen-enter { animation: pl-screen-in .32s var(--pl-ease); }
@keyframes pl-screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pl-fade-enter { animation: pl-fade .3s var(--pl-ease); }
@keyframes pl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pl-fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes pl-floor-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.pl-finance-dock, .pl-notes-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 50px;
  background: rgba(253, 251, 247, 0.88);
  backdrop-filter: blur(12px) saturate(190%);
  -webkit-backdrop-filter: blur(12px) saturate(190%);
  border: 1px solid var(--pl-border);
  border-radius: 25px;
  box-shadow: 0 8px 24px rgba(20, 16, 10, 0.12), 0 2px 6px rgba(20, 16, 10, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 8px;
  z-index: 45;
  animation: pl-dock-slide-in 0.28s var(--pl-ease) forwards;
}
@keyframes pl-dock-slide-in {
  from {
    transform: translateY(120%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.pl-dark .pl-finance-dock, .pl-dark .pl-notes-dock {
  background: rgba(26, 22, 17, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pl-dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--pl-text-soft);
  transition: all 0.16s var(--pl-ease);
  background: none;
  border: none;
  font-family: var(--pl-font);
  outline: none;
  height: 42px;
  border-radius: 21px;
  padding: 0;
}
.pl-dock-item:active {
  background: var(--pl-surface-2);
  opacity: 0.95;
}
.pl-dock-item svg {
  color: var(--pl-text-soft);
  transition: transform 0.15s var(--pl-ease);
}
.pl-dock-item:hover svg, .pl-dock-item:active svg {
  transform: translateY(-2px);
  color: var(--pl-primary-600);
}
.pl-dark .pl-dock-item:hover svg, .pl-dark .pl-dock-item:active svg {
  color: var(--pl-text);
}
.pl-dock-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--pl-text-soft);
  margin-top: 1px;
}
.pl-dock-item:hover span, .pl-dock-item:active span {
  color: var(--pl-text);
}

/* Estado activo para ítems del dock */
.pl-dock-item.is-active svg {
  color: var(--pl-accent-400);
  transform: translateY(-2px);
}
.pl-dock-item.is-active span {
  color: var(--pl-primary-700);
  font-weight: 700;
}
.pl-dark .pl-dock-item.is-active svg {
  color: var(--pl-accent-300);
}
.pl-dark .pl-dock-item.is-active span {
  color: var(--pl-gray-100);
}

/* ---------- COMMAND OVERLAY (Esfera Pleno Hub) ---------- */
.pl-cmd-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 5, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  animation: pl-cmd-overlay-in 0.28s var(--pl-ease) forwards;
}

.pl-cmd-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  transition: all 0.16s var(--pl-ease);
  z-index: 202;
  outline: none;
}

.pl-cmd-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: scale(1.05);
}

.pl-cmd-close:active {
  transform: scale(0.95);
}

.pl-cmd-sphere-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto;
}

.pl-cmd-sphere-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--pl-accent-400) 0%, transparent 70%);
  opacity: 0.18;
  transform: scale(1.3);
  animation: pl-cmd-breathe 2.5s infinite ease-in-out;
}

.pl-cmd-sphere {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pl-primary-600) 0%, var(--pl-accent-500) 100%);
  box-shadow: 0 8px 28px rgba(181, 144, 74, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pl-cmd-breathe 2s infinite ease-in-out;
  transition: all 0.3s var(--pl-ease);
}

.pl-cmd-sphere.is-thinking {
  background: linear-gradient(135deg, var(--pl-accent-500) 0%, var(--pl-primary-600) 100%);
  box-shadow: 0 0 35px rgba(181, 144, 74, 0.65);
  animation: pl-cmd-think 0.8s infinite ease-in-out;
}

.pl-cmd-input-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2px;
  display: flex;
  align-items: center;
  margin: 0 20px 16px;
  transition: all 0.2s var(--pl-ease);
}

.pl-cmd-input-wrap:focus-within {
  border-color: rgba(181, 144, 74, 0.45);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(181, 144, 74, 0.12);
}

.pl-cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--pl-font);
  font-size: 15px;
  color: #fff;
  padding: 12px 18px;
}

.pl-cmd-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.pl-cmd-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.2s var(--pl-ease);
  outline: none;
}

.pl-cmd-send.is-active {
  background: var(--pl-accent-500);
  color: #000;
  box-shadow: 0 4px 10px rgba(181, 144, 74, 0.3);
}

.pl-cmd-send:not(.is-active) {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.pl-cmd-chips-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  margin: 0 20px 8px;
}

.pl-cmd-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 4px;
}

.pl-cmd-chips::-webkit-scrollbar {
  display: none;
}

.pl-cmd-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--pl-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s var(--pl-ease);
  white-space: nowrap;
  outline: none;
}

.pl-cmd-chip:hover {
  border-color: rgba(181, 144, 74, 0.35);
  color: #fff;
  background: rgba(181, 144, 74, 0.06);
}

.pl-cmd-chip:active {
  transform: scale(0.97);
}

.pl-cmd-result {
  background: linear-gradient(135deg, rgba(181, 144, 74, 0.15) 0%, rgba(181, 144, 74, 0.05) 100%);
  border: 1px solid rgba(181, 144, 74, 0.25);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 0 20px 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  animation: pl-cmd-result-in 0.28s var(--pl-ease) forwards;
}

.pl-cmd-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 24px 20px;
}

.pl-cmd-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  animation: pl-cmd-msg-in 0.22s var(--pl-ease) forwards;
}

.pl-cmd-msg.is-user {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.pl-cmd-msg.is-ai {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  white-space: pre-wrap;
}

/* ---------- KEYFRAMES ---------- */
@keyframes pl-cmd-overlay-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pl-cmd-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.05); opacity: 1; }
}

@keyframes pl-cmd-think {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes pl-cmd-result-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pl-cmd-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- ESFERA PLENO GOLD WAVES ---------- */
.pl-esfera-pleno {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(0, 0, 0, 0.15) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1.2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 0 20px rgba(255, 215, 120, 0.12), 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 4px 6px rgba(255, 255, 255, 0.35),
    inset -2px -4px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(255, 220, 150, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1000px;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: pl-esfera-pulse 4.5s infinite alternate ease-in-out;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

.pl-esfera-waves-wrap {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.pl-esfera-wave {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 200%;
  height: 100%;
  transform: translate3d(0, 0, 0);
}

.pl-esfera-wave.back {
  opacity: 0.45;
  animation: pl-wave-flow-back 6s infinite linear;
  z-index: 1;
}

.pl-esfera-wave.front {
  opacity: 0.95;
  animation: pl-wave-flow-front 3.8s infinite linear;
  z-index: 2;
  filter: drop-shadow(0 -1px 2px rgba(90, 58, 11, 0.45));
}

@keyframes pl-wave-flow-back {
  0% { transform: translate3d(0, 4px, 0) scaleY(1); }
  50% { transform: translate3d(-25%, 1px, 0) scaleY(1.1); }
  100% { transform: translate3d(-50%, 4px, 0) scaleY(1); }
}

@keyframes pl-wave-flow-front {
  0% { transform: translate3d(0, 0, 0) scaleY(1); }
  50% { transform: translate3d(-25%, 3px, 0) scaleY(0.9); }
  100% { transform: translate3d(-50%, 0, 0) scaleY(1); }
}

.pl-esfera-glass-highlight {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 18px;
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 60%, transparent 100%);
  border-radius: 50% 50% 45% 45%;
  z-index: 4;
  pointer-events: none;
}

.pl-esfera-ambient-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 90%, rgba(212, 175, 55, 0.35) 0%, rgba(170, 124, 17, 0.05) 60%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

@keyframes pl-esfera-pulse {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.02) rotate(0.5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ============================================================
   RESPONSIVE — WEB (tablet y desktop). El interior mobile no se toca:
   estas reglas solo aplican dentro de .pl-frame-tablet / .pl-frame-desktop.
   La marca del sidebar está oculta por defecto (solo se muestra en desktop).
   ============================================================ */
.pl-nav-brand { display: none; }

/* ---------- TABLET (601-1023px): columna centrada tipo mobile ---------- */
/* Los bottom sheets se ciñen al ancho de la columna (no al viewport). */
.pl-frame-tablet .pl-sheet {
  left: 50%; right: auto;
  width: min(460px, 100%);
  transform: translateX(-50%) translateY(100%);
}
.pl-frame-tablet .pl-sheet.show { transform: translateX(-50%) translateY(0); }

/* ---------- DESKTOP (>=1024px): layout de web app (estilo Mercado Pago) ----------
   Sidebar fijo + área de contenido ANCHA (max 960px centrada en el espacio restante),
   Esfera PLENO flotante abajo a la derecha. Nada de columna angosta de celular. */
.pl-frame-desktop {
  --pl-side-w: 248px;
  --pl-content-max: 960px;
  /* margen a cada lado del contenido dentro del espacio libre a la derecha del sidebar */
  --pl-col-gap: max(32px, calc((100vw - var(--pl-side-w) - var(--pl-content-max)) / 2));
}

/* Bottom nav → sidebar vertical fijo a la izquierda.
   !important porque el <nav> trae estilos inline (height/left/right/bottom) del mobile. */
.pl-frame-desktop .pl-bottomnav {
  top: 0 !important; bottom: 0 !important; left: 0 !important; right: auto !important;
  width: var(--pl-side-w) !important; height: auto !important;
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 4px; padding: 20px 14px;
  border-top: none; border-right: 1px solid var(--pl-border);
}
.pl-frame-desktop .pl-nav-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 18px; font-family: var(--pl-font);
  font-weight: 800; font-size: 20px; letter-spacing: .04em; color: var(--pl-text);
}
.pl-frame-desktop .pl-navitem {
  flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
  gap: 14px; padding: 12px 14px; border-radius: 14px; height: auto;
  transition: background .15s var(--pl-ease), color .15s var(--pl-ease);
}
.pl-frame-desktop .pl-navitem span { font-size: 14.5px; font-weight: 600; }
.pl-frame-desktop .pl-navitem:hover { background: var(--pl-surface-2); }
.pl-frame-desktop .pl-navitem.is-active { background: var(--pl-accent-50); color: var(--pl-accent-600); }
.pl-frame-desktop .pl-navitem.is-active::before { display: none; }

/* Sub-navegación desplegada bajo el ítem padre (ex dock flotante) */
.pl-frame-desktop .pl-nav-sub {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 6px 26px; padding-left: 12px;
  border-left: 1.5px solid var(--pl-border);
  animation: pl-nav-sub-in .22s var(--pl-ease);
}
@keyframes pl-nav-sub-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pl-frame-desktop .pl-nav-subitem {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 11px;
  background: none; border: none; cursor: pointer;
  font-family: var(--pl-font); color: var(--pl-text-soft);
  transition: background .15s var(--pl-ease), color .15s var(--pl-ease);
  text-align: left;
}
.pl-frame-desktop .pl-nav-subitem span { font-size: 13.5px; font-weight: 500; }
.pl-frame-desktop .pl-nav-subitem:hover { background: var(--pl-surface-2); color: var(--pl-text); }
.pl-frame-desktop .pl-nav-subitem.is-active { color: var(--pl-accent-600); font-weight: 600; }
.pl-frame-desktop .pl-nav-subitem.is-active span { font-weight: 600; }

/* Esfera PLENO FLOTANTE abajo a la derecha (estilo asistente).
   Sale del flujo del sidebar (position:fixed); el botón conserva sus handlers de voz.
   El box-shadow NO se pisa (el estado "escuchando" usa shadow inline): el glow va
   como drop-shadow en el wrapper. */
.pl-frame-desktop .pl-esfera-navwrap {
  position: fixed !important;
  left: auto !important; top: auto !important;
  right: 30px; bottom: 30px;
  width: auto; height: auto;
  flex: 0 0 auto !important;
  margin: 0; padding: 0;
  z-index: 80;
  filter: drop-shadow(0 10px 28px rgba(20, 16, 10, .35)) drop-shadow(0 0 18px rgba(229, 193, 88, .3));
}
.pl-frame-desktop .pl-esfera-navwrap .pl-esfera-button {
  position: relative !important; top: 0 !important; margin: 0;
  width: 64px !important; height: 64px !important;
}
.pl-frame-desktop .pl-esfera-navlabel { display: none; }

/* Área de contenido ANCHA: ocupa todo el espacio a la derecha del sidebar;
   cada pantalla se centra con un máximo cómodo de lectura (--pl-content-max). */
.pl-frame-desktop .pl-app-content {
  left: var(--pl-side-w) !important;
  right: 0 !important;
  bottom: 0 !important;
  background: var(--pl-bg);
}
.pl-frame-desktop .pl-app-content > * {
  max-width: var(--pl-content-max);
  margin-left: auto;
  margin-right: auto;
}
/* El editor de Notas de dos paneles (estilo Evernote) usa TODO el ancho disponible */
.pl-frame-desktop .pl-app-content > .pl-notas-2pane {
  max-width: none;
  margin: 0;
}

/* Docks (Finanzas/Notas): centrados bajo el contenido, con ancho acotado
   (left+right+max-width+margin:auto centra un elemento absoluto sobre-restringido).
   Máx 560px para no chocar con la Esfera flotante en monitores de 1024px. */
.pl-frame-desktop .pl-finance-dock,
.pl-frame-desktop .pl-notes-dock {
  left: calc(var(--pl-side-w) + var(--pl-col-gap)) !important;
  right: var(--pl-col-gap) !important;
  bottom: 20px !important;
  max-width: 560px;
  margin: 0 auto;
}
/* FAB apilado ARRIBA de la Esfera (misma esquina, sin solaparse) */
.pl-frame-desktop .pl-fab { right: 33px !important; bottom: 112px !important; }
.pl-frame-desktop .pl-toast {
  left: calc(var(--pl-side-w) + var(--pl-col-gap) + 16px) !important;
  right: calc(var(--pl-col-gap) + 16px) !important;
  bottom: 20px !important;
  max-width: 520px;
  margin: 0 auto;
}

/* Bottom sheets → modales centrados en desktop */
.pl-frame-desktop .pl-sheet {
  left: 50%; right: auto; top: 50%; bottom: auto;
  width: min(460px, 92vw); max-height: 86vh;
  border-radius: 20px;
  transform: translate(-50%, -46%);
  opacity: 0;
  transition: transform .28s var(--pl-ease), opacity .24s var(--pl-ease);
}
.pl-frame-desktop .pl-sheet.show { transform: translate(-50%, -50%); opacity: 1; }
.pl-frame-desktop .pl-sheet-grip { display: none; }

