:root {
  --timoteo-brand: #A97155;
  --timoteo-cream: #f8f7f4;
  --timoteo-dark: #2B1D18;
}

#timoteo-widget {
  position: fixed;
  left: auto;
  right: 16px;
  bottom: 16px;
  z-index: 10050;
  pointer-events: none;
}

#timoteo-widget * {
  box-sizing: border-box;
}

.timoteo__wrap {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.timoteo__dog {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: rgba(248, 247, 244, .92);
  border: 2px solid rgba(169, 113, 85, .55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.timoteo__dog img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform: scale(1.1);
  /* Un poco mas grande para que llene bien */
}

.timoteo__dog:focus {
  outline: 3px solid rgba(169, 113, 85, .35);
  outline-offset: 3px;
}

.timoteo__bubble {
  display: none;
  max-width: min(320px, calc(100vw - 110px));
  background: rgba(248, 247, 244, .96);
  color: var(--timoteo-dark);
  border: 1px solid rgba(169, 113, 85, .35);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  /* Reduced from 14px */
  line-height: 1.35;
}

.timoteo__bubble[aria-hidden="false"] {
  display: block;
}

.timoteo__bubble strong {
  font-weight: 800;
}

.timoteo__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.timoteo__btn {
  appearance: none;
  border: 0;
  background: var(--timoteo-brand);
  color: #fff;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.timoteo__btn--ghost {
  background: transparent;
  color: var(--timoteo-dark);
  border: 1px solid rgba(169, 113, 85, .5);
}

.timoteo__panel {
  position: fixed;
  right: 16px;
  bottom: 98px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 140px));
  pointer-events: auto;
  background: rgba(248, 247, 244, .98);
  color: var(--timoteo-dark);
  border: 1px solid rgba(169, 113, 85, .35);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  overflow: hidden;
  display: none;
}

.timoteo__panel[aria-hidden="false"] {
  display: flex;
  flex-direction: column;
}

.timoteo__panelHeader {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(169, 113, 85, .18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timoteo__panelHeader h3 {
  margin: 0;
  font-size: 13px;
  /* Reduced from 14px */
  letter-spacing: .2px;
}

.timoteo__panelBody {
  padding: 12px 14px 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.timoteo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.timoteo__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(169, 113, 85, .35);
  background: #fff;
  color: var(--timoteo-dark);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.timoteo__chip:hover {
  border-color: rgba(169, 113, 85, .6);
}

.timoteo__links {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.timoteo__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(169, 113, 85, .18);
  text-decoration: none;
  color: var(--timoteo-dark);
  font-weight: 700;
}

.timoteo__link:hover {
  border-color: rgba(169, 113, 85, .45);
}

.timoteo__muted {
  opacity: .78;
  font-weight: 600;
}

/* Running animation (solo en index) */
#timoteo-widget.timoteo--running {
  left: -90px;
  right: auto;
  animation: timoteo-run 4.6s cubic-bezier(.2, .8, .2, 1) forwards;
}

@keyframes timoteo-run {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(100vw - 120px));
  }
}

/* Docked state */
#timoteo-widget.timoteo--docked {
  left: auto;
  right: 16px;
  transform: none !important;
  animation: none !important;
}

@media (max-width: 480px) {
  /* Modo "Mobile Friendly": Bottom Sheet Lite */

  /* Widget base */
  #timoteo-widget {
    bottom: 0;
    right: 0;
    left: 0;
    pointer-events: none;
  }

  .timoteo__wrap {
    padding: 0 16px 16px;
    justify-content: flex-end;
  }

  /* Perrito */
  .timoteo__dog {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .timoteo__dog img {
    width: 100%;
    height: 100%;
  }

  /* Burbuja compacta y ligera */
  .timoteo__bubble {
    max-width: calc(100vw - 90px);
    font-size: 12px;
    padding: 10px 12px;
    border-radius: 20px 20px 4px 20px;
  }

  .timoteo__bubble strong {
    font-weight: 700;
  }

  /* Menos negrita */

  .timoteo__btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    /* Lighter weight */
  }

  /* PANEL BOTTOM SHEET (Hoja deslizante) */
  .timoteo__panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    border: none;
    border-top: 1px solid rgba(169, 113, 85, .2);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    background: #fff;

    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .timoteo__panel[aria-hidden="false"] {
    display: flex;
    transform: translateY(0);
  }

  /* Cabecera del panel */
  .timoteo__panelHeader {
    padding: 14px 18px;
    background: var(--timoteo-cream);
  }

  .timoteo__panelHeader h3 {
    font-size: 13px;
    font-weight: 700;
    /* Menos negrita */
  }

  /* Cuerpo del panel */
  .timoteo__panelBody {
    padding: 16px;
  }

  .timoteo__muted {
    font-size: 13px;
    font-weight: 500;
  }

  /* Chips compactos y ligeros */
  .timoteo__chip {
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 12px;
    border-width: 1px;
    font-weight: 600;
    /* Menos negrita */
    background: var(--timoteo-cream);
  }

  /* Links compactos y ligeros */
  .timoteo__link {
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    /* Menos negrita */
  }
}